├── .github └── FUNDING.yml ├── packaging ├── Fuji.png ├── Fuji.icns ├── screenshot.png ├── supporters │ ├── fuji-video.png │ └── 13Cubed.svg ├── Full Disk Access Settings.url ├── Fuji.sh ├── dmgbuild.py └── LICENSE.rtf ├── meta.py ├── requirements.txt ├── checks ├── abstract.py ├── name.py ├── network.py ├── folders.py └── free_space.py ├── shared └── utils.py ├── acquisition ├── asr.py ├── rsync.py ├── sysdiagnose.py └── abstract.py ├── Fuji.spec ├── .gitignore ├── README.md ├── fuji.py └── LICENSE.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: thelazza 2 | -------------------------------------------------------------------------------- /packaging/Fuji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lazza/Fuji/HEAD/packaging/Fuji.png -------------------------------------------------------------------------------- /packaging/Fuji.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lazza/Fuji/HEAD/packaging/Fuji.icns -------------------------------------------------------------------------------- /packaging/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lazza/Fuji/HEAD/packaging/screenshot.png -------------------------------------------------------------------------------- /meta.py: -------------------------------------------------------------------------------- 1 | VERSION = "1.1.0" 2 | AUTHOR = "Andrea Lazzarotto" 3 | HOMEPAGE = "https://andrealazzarotto.com" 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | dmgbuild[badge_icons]==1.6.1 2 | humanize==4.9.0 3 | pyinstaller==6.6.0 4 | wxPython==4.2.0 5 | -------------------------------------------------------------------------------- /packaging/supporters/fuji-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lazza/Fuji/HEAD/packaging/supporters/fuji-video.png -------------------------------------------------------------------------------- /packaging/Full Disk Access Settings.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles 3 | -------------------------------------------------------------------------------- /packaging/Fuji.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | ./Fuji.bin 7 | else 8 | security execute-with-privileges "./Fuji.bin" 9 | fi 10 | -------------------------------------------------------------------------------- /checks/abstract.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from dataclasses import dataclass 3 | 4 | from acquisition.abstract import Parameters 5 | 6 | 7 | @dataclass 8 | class CheckResult: 9 | passed: bool = True 10 | message: str = "" 11 | 12 | def write(self, content: str): 13 | if self.message: 14 | self.message = self.message + "\n" + content 15 | else: 16 | self.message = content 17 | 18 | 19 | class Check(ABC): 20 | name = "Abstract check" 21 | 22 | @abstractmethod 23 | def execute(self, params: Parameters) -> CheckResult: 24 | pass 25 | -------------------------------------------------------------------------------- /shared/utils.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from typing import List, Tuple 3 | 4 | 5 | def lines_to_properties(lines: List[str], separator=":", strip_chars=None) -> dict: 6 | result = {} 7 | 8 | for line in filter((lambda x: separator in x), lines): 9 | key, value = line.split(separator, 1) 10 | result[key.strip(strip_chars)] = value.strip(strip_chars) 11 | 12 | return result 13 | 14 | 15 | def command_to_properties( 16 | arguments: List[str], separator=":", strip_chars=None 17 | ) -> dict: 18 | output = subprocess.check_output(arguments, universal_newlines=True) 19 | return lines_to_properties(output.splitlines(), separator, strip_chars) 20 | -------------------------------------------------------------------------------- /packaging/dmgbuild.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | # This will be called from the parent directory 5 | project_directory = Path(os.getcwd()) 6 | dist_directory = project_directory / "dist" 7 | pack_directory = project_directory / "packaging" 8 | 9 | # File names 10 | settings_file = "Full Disk Access Settings.url" 11 | fuji_app_file = "Fuji.app" 12 | license_file = "LICENSE.rtf" 13 | 14 | files = [ 15 | str(pack_directory / settings_file), 16 | str(dist_directory / fuji_app_file), 17 | str(pack_directory / license_file), 18 | ] 19 | icon_locations = { 20 | settings_file: (128, 128), 21 | fuji_app_file: (320, 128), 22 | license_file: (512, 128), 23 | } 24 | badge_icon = str(pack_directory / "Fuji.icns") 25 | left_bottom_coordinates = (200, 300) 26 | width_height = (640, 480) 27 | window_rect = (left_bottom_coordinates, width_height) 28 | -------------------------------------------------------------------------------- /checks/name.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from acquisition.abstract import Parameters 4 | from checks.abstract import Check, CheckResult 5 | 6 | 7 | class NameCheck(Check): 8 | name = "Name check" 9 | 10 | def execute(self, params: Parameters) -> CheckResult: 11 | special_extensions = { 12 | ".app", 13 | ".bundle", 14 | ".logarchive", 15 | ".pkg", 16 | ".sparsebundle", 17 | ".workflow", 18 | ".xpc", 19 | } 20 | result = CheckResult(passed=True) 21 | 22 | # Get extension from image name 23 | _, ext = os.path.splitext(params.image_name) 24 | ext = ext.lower() 25 | 26 | if ext in special_extensions: 27 | result.passed = False 28 | result.write( 29 | f'Special extension "{ext}" shall not be used in the image name!' 30 | ) 31 | else: 32 | result.write(f"The image name is valid") 33 | 34 | return result 35 | -------------------------------------------------------------------------------- /checks/network.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | from acquisition.abstract import Parameters 4 | from checks.abstract import Check, CheckResult 5 | 6 | 7 | class NetworkCheck(Check): 8 | name = "Network check" 9 | 10 | def execute(self, params: Parameters) -> CheckResult: 11 | result = CheckResult() 12 | 13 | # This is the CDN server used by the 'networkquality' command 14 | apple_server = "mensura.cdn-apple.com" 15 | 16 | try: 17 | http_test = subprocess.check_output( 18 | ["nc", "-z", apple_server, "80", "-G1"], 19 | stderr=subprocess.STDOUT, 20 | universal_newlines=True, 21 | ) 22 | connected = "succeeded!" in http_test 23 | except: 24 | connected = False 25 | 26 | if connected: 27 | result.write("This Mac is connected to the Internet!") 28 | result.passed = False 29 | else: 30 | result.write("This Mac is not connected to the Internet") 31 | result.passed = True 32 | 33 | return result 34 | -------------------------------------------------------------------------------- /acquisition/asr.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from acquisition.abstract import AcquisitionMethod, Parameters, Report 3 | 4 | 5 | class AsrMethod(AcquisitionMethod): 6 | name = "ASR" 7 | description = """Apple Software Restore logical acquisition. 8 | This is the recommended option, but it works only for volumes.""" 9 | 10 | def execute(self, params: Parameters) -> Report: 11 | # Prepare report 12 | report = Report(params, self, start_time=datetime.now()) 13 | report.path_details = self._gather_path_info(params.source) 14 | report.hardware_info = self._gather_hardware_info() 15 | 16 | success = self._create_temporary_image(report) 17 | if not success: 18 | return report 19 | 20 | print("\nASR", params.source, "->", self.temporary_volume) 21 | command = [ 22 | "asr", 23 | "restore", 24 | "--source", 25 | f"{params.source}", 26 | "--target", 27 | self.temporary_volume, 28 | "--noprompt", 29 | "--erase", 30 | ] 31 | status, output = self._run_process(command) 32 | 33 | # Sometimes ASR crashes at the end but the acquisition is still OK 34 | success = status == 0 or ( 35 | output.count("..100") > 1 and "Restored target" in output 36 | ) 37 | 38 | if not success: 39 | return report 40 | 41 | return self._dmg_and_hash(report) 42 | -------------------------------------------------------------------------------- /Fuji.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | import importlib 4 | import subprocess 5 | import sys 6 | from pathlib import Path 7 | from shutil import copy, move 8 | 9 | sys.path.insert(0, ".") 10 | meta = importlib.import_module("meta") 11 | 12 | 13 | a = Analysis( 14 | ["fuji.py"], 15 | pathex=[], 16 | binaries=[], 17 | datas=[], 18 | hiddenimports=[], 19 | hookspath=[], 20 | hooksconfig={}, 21 | runtime_hooks=[], 22 | excludes=[], 23 | noarchive=False, 24 | optimize=0, 25 | ) 26 | pyz = PYZ(a.pure) 27 | 28 | exe = EXE( 29 | pyz, 30 | a.scripts, 31 | [], 32 | exclude_binaries=True, 33 | name="Fuji", 34 | debug=False, 35 | bootloader_ignore_signals=False, 36 | strip=False, 37 | upx=True, 38 | console=False, 39 | disable_windowed_traceback=False, 40 | argv_emulation=False, 41 | target_arch="universal2", 42 | codesign_identity=None, 43 | entitlements_file=None, 44 | icon=["packaging/Fuji.icns"], 45 | ) 46 | coll = COLLECT( 47 | exe, 48 | a.binaries, 49 | a.datas, 50 | strip=False, 51 | upx=True, 52 | upx_exclude=[], 53 | name="Fuji", 54 | ) 55 | app = BUNDLE( 56 | coll, 57 | name="Fuji.app", 58 | icon="./packaging/Fuji.icns", 59 | bundle_identifier="com.andrealazzarotto.fuji", 60 | version=meta.VERSION, 61 | ) 62 | 63 | executable_path = Path("./dist/Fuji.app/Contents/MacOS") 64 | move(executable_path / "Fuji", executable_path / "Fuji.bin") 65 | copy("./packaging/Fuji.sh", executable_path / "Fuji") 66 | 67 | dmg_path = "./dist/FujiApp.dmg" 68 | print("Building", dmg_path) 69 | result = subprocess.call( 70 | ["dmgbuild", "-s", "./packaging/dmgbuild.py", "FujiApp", dmg_path] 71 | ) 72 | if result == 0: 73 | print("Done") 74 | else: 75 | print("Failed!!!") 76 | -------------------------------------------------------------------------------- /checks/folders.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from acquisition.abstract import Parameters 4 | from checks.abstract import Check, CheckResult 5 | 6 | 7 | class FoldersCheck(Check): 8 | name = "Folders check" 9 | 10 | def execute(self, params: Parameters) -> CheckResult: 11 | result = CheckResult(passed=True) 12 | 13 | source_is_directory = os.path.isdir(params.source) 14 | if not source_is_directory: 15 | result.write("Source is not a directory!") 16 | result.passed = False 17 | 18 | same_path = params.tmp == params.destination 19 | 20 | tmp_is_directory = os.path.isdir(params.tmp) 21 | destination_is_directory = os.path.isdir(params.destination) 22 | 23 | tmp_path = params.tmp / params.image_name 24 | tmp_busy = os.path.exists(tmp_path) 25 | destination_path = params.destination / params.image_name 26 | destination_busy = os.path.exists(destination_path) 27 | 28 | if not same_path: 29 | if not tmp_is_directory: 30 | result.write("Temp image location is not a directory!") 31 | result.passed = False 32 | elif tmp_busy: 33 | result.write( 34 | f"Temp image location already contains {params.image_name}!" 35 | ) 36 | result.passed = False 37 | else: 38 | result.write("Temp image location is a valid directory") 39 | 40 | if not destination_is_directory: 41 | result.write("Destination is not a directory!") 42 | result.passed = False 43 | elif destination_busy: 44 | result.write(f"Destination already contains {params.image_name}!") 45 | result.passed = False 46 | else: 47 | result.write("Destination is a valid directory") 48 | 49 | return result 50 | -------------------------------------------------------------------------------- /acquisition/rsync.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from pathlib import Path 3 | from typing import List 4 | 5 | from acquisition.abstract import AcquisitionMethod, Parameters, Report 6 | 7 | 8 | class RsyncMethod(AcquisitionMethod): 9 | name = "Rsync" 10 | description = """Files and directories are copied using Rsync. 11 | This is slower but it can be used on any source directory. Errors are ignored.""" 12 | 13 | def _compute_exclusions(self, params: Parameters) -> List[Path]: 14 | # Rsync can be tricked into acquiring files multiple times by macOS, due 15 | # to how it handles mount points inside the APFS container. This method 16 | # aims to prevent acquiring duplicates of the same files. 17 | 18 | _, mount_points = self._run_silent(["mount"]) 19 | lines = mount_points.splitlines() 20 | 21 | source_info = self._gather_path_info(params.source) 22 | source_disk = source_info.disk_parent 23 | 24 | results = [] 25 | for line in lines: 26 | if not (line.startswith("/dev/disk") and " on " in line): 27 | continue 28 | device = line.split(" on ")[0] 29 | point = line.split(" on ")[1].split("(")[0].strip() 30 | point_path = Path(point) 31 | point_disk = self._disk_from_device(device) 32 | 33 | if point_disk == source_disk and params.source in point_path.parents: 34 | results.append(point_path) 35 | 36 | return results 37 | 38 | def execute(self, params: Parameters) -> Report: 39 | # Prepare report 40 | report = Report(params, self, start_time=datetime.now()) 41 | report.path_details = self._gather_path_info(params.source) 42 | report.hardware_info = self._gather_hardware_info() 43 | 44 | print("Computing exclusions...") 45 | exclusions = self._compute_exclusions(params) 46 | 47 | success = self._create_temporary_image(report) 48 | if not success: 49 | return report 50 | 51 | print("\nRsync", params.source, "->", self.temporary_mount) 52 | source_str = f"{params.source}" 53 | if not source_str.endswith("/"): 54 | source_str = source_str + "/" 55 | command = ["rsync", "-xrlptgoEv", "--progress"] 56 | for exclusion in exclusions: 57 | command.extend(["--exclude", f"{exclusion}/"]) 58 | command.extend([source_str, self.temporary_mount]) 59 | status = self._run_status(command) 60 | 61 | # We cannot rely on the exit code, because it will probably contain some 62 | # errors if a few files cannot be copied. 63 | if status != 0: 64 | print(f"Rsync terminated (with status {status})") 65 | else: 66 | print("Rsync terminated") 67 | 68 | return self._dmg_and_hash(report) 69 | -------------------------------------------------------------------------------- /checks/free_space.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import humanize 4 | from acquisition.abstract import Parameters 5 | from checks.abstract import Check, CheckResult 6 | 7 | 8 | class FreeSpaceCheck(Check): 9 | name = "Free space check" 10 | 11 | def _get_used_space(self, path): 12 | try: 13 | statvfs = os.statvfs(path) 14 | except FileNotFoundError: 15 | return 0 16 | total_space = statvfs.f_blocks * statvfs.f_frsize 17 | free_space = statvfs.f_bfree * statvfs.f_frsize 18 | return total_space - free_space 19 | 20 | def _get_free_space(self, path): 21 | try: 22 | statvfs = os.statvfs(path) 23 | except FileNotFoundError: 24 | return 0 25 | free_space = statvfs.f_bfree * statvfs.f_frsize 26 | return free_space 27 | 28 | def execute(self, params: Parameters) -> CheckResult: 29 | result = CheckResult() 30 | 31 | source_used = self._get_used_space(params.source) 32 | tmp_string = f"{params.tmp}" 33 | destination_string = f"{params.destination}" 34 | same_volume = tmp_string.startswith( 35 | destination_string 36 | ) or destination_string.startswith(tmp_string) 37 | 38 | if same_volume: 39 | destination_free = self._get_free_space(params.destination) 40 | result.passed = destination_free >= 2 * source_used 41 | 42 | needed_readable = humanize.naturalsize(2 * source_used) 43 | free_readable = humanize.naturalsize(destination_free) 44 | tail = f"(up to {needed_readable} / {free_readable})" 45 | if result.passed: 46 | result.write(f"Free space in destination seems enough {tail}") 47 | else: 48 | result.write(f"Free space in destination could be insufficient {tail}") 49 | 50 | else: 51 | tmp_free = self._get_free_space(params.tmp) 52 | tmp_passed = tmp_free and tmp_free >= source_used 53 | tmp_needed_readable = humanize.naturalsize(source_used) 54 | tmp_free_readable = humanize.naturalsize(tmp_free) 55 | 56 | destination_free = self._get_free_space(params.destination) 57 | destination_passed = destination_free and destination_free >= source_used 58 | destination_needed_readable = humanize.naturalsize(source_used) 59 | destination_free_readable = humanize.naturalsize(destination_free) 60 | 61 | result.passed = tmp_passed and destination_passed 62 | tmp_tail = f"(up to {tmp_needed_readable} / {tmp_free_readable})" 63 | if tmp_passed: 64 | result.write( 65 | f"Free space in temp image location seems enough {tmp_tail}" 66 | ) 67 | else: 68 | result.write( 69 | f"Free space in temp image location could be insufficient {tmp_tail}" 70 | ) 71 | 72 | destination_tail = ( 73 | f"(up to {destination_needed_readable} / {destination_free_readable})" 74 | ) 75 | if destination_passed: 76 | result.write( 77 | f"Free space in destination seems enough {destination_tail}" 78 | ) 79 | else: 80 | result.write( 81 | f"Free space in destination could be insufficient {destination_tail}" 82 | ) 83 | 84 | return result 85 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/python 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=python 3 | 4 | ### Python ### 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | share/python-wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | #*.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .nox/ 47 | .coverage 48 | .coverage.* 49 | .cache 50 | nosetests.xml 51 | coverage.xml 52 | *.cover 53 | *.py,cover 54 | .hypothesis/ 55 | .pytest_cache/ 56 | cover/ 57 | 58 | # Translations 59 | *.mo 60 | *.pot 61 | 62 | # Django stuff: 63 | *.log 64 | local_settings.py 65 | db.sqlite3 66 | db.sqlite3-journal 67 | 68 | # Flask stuff: 69 | instance/ 70 | .webassets-cache 71 | 72 | # Scrapy stuff: 73 | .scrapy 74 | 75 | # Sphinx documentation 76 | docs/_build/ 77 | 78 | # PyBuilder 79 | .pybuilder/ 80 | target/ 81 | 82 | # Jupyter Notebook 83 | .ipynb_checkpoints 84 | 85 | # IPython 86 | profile_default/ 87 | ipython_config.py 88 | 89 | # pyenv 90 | # For a library or package, you might want to ignore these files since the code is 91 | # intended to run in multiple environments; otherwise, check them in: 92 | # .python-version 93 | 94 | # pipenv 95 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 96 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 97 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 98 | # install all needed dependencies. 99 | #Pipfile.lock 100 | 101 | # poetry 102 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 103 | # This is especially recommended for binary packages to ensure reproducibility, and is more 104 | # commonly ignored for libraries. 105 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 106 | #poetry.lock 107 | 108 | # pdm 109 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 110 | #pdm.lock 111 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 112 | # in version control. 113 | # https://pdm.fming.dev/#use-with-ide 114 | .pdm.toml 115 | 116 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 117 | __pypackages__/ 118 | 119 | # Celery stuff 120 | celerybeat-schedule 121 | celerybeat.pid 122 | 123 | # SageMath parsed files 124 | *.sage.py 125 | 126 | # Environments 127 | .env 128 | .venv 129 | env/ 130 | venv/ 131 | ENV/ 132 | env.bak/ 133 | venv.bak/ 134 | 135 | # Spyder project settings 136 | .spyderproject 137 | .spyproject 138 | 139 | # Rope project settings 140 | .ropeproject 141 | 142 | # mkdocs documentation 143 | /site 144 | 145 | # mypy 146 | .mypy_cache/ 147 | .dmypy.json 148 | dmypy.json 149 | 150 | # Pyre type checker 151 | .pyre/ 152 | 153 | # pytype static type analyzer 154 | .pytype/ 155 | 156 | # Cython debug symbols 157 | cython_debug/ 158 | 159 | # PyCharm 160 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 161 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 162 | # and can be added to the global gitignore or merged into this file. For a more nuclear 163 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 164 | #.idea/ 165 | 166 | ### Python Patch ### 167 | # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration 168 | poetry.toml 169 | 170 | # ruff 171 | .ruff_cache/ 172 | 173 | # LSP config files 174 | pyrightconfig.json 175 | 176 | # End of https://www.toptal.com/developers/gitignore/api/python 177 | -------------------------------------------------------------------------------- /packaging/supporters/13Cubed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /acquisition/sysdiagnose.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sqlite3 3 | import time 4 | from datetime import datetime 5 | from pathlib import Path 6 | 7 | from acquisition.abstract import AcquisitionMethod, Parameters, Report 8 | 9 | 10 | class SysdiagnoseMethod(AcquisitionMethod): 11 | name = "Sysdiagnose" 12 | description = """System logs and configuration. 13 | This only acquires system data and unified logs (converted to SQLite).""" 14 | 15 | def _write_log_line(self, line: str, cursor: sqlite3.Cursor) -> None: 16 | data = json.loads(line) 17 | 18 | backtrace_frames = data.get("backtrace", {}).get("frames", []) 19 | cursor.execute( 20 | """ 21 | INSERT INTO system_logs ( 22 | timestamp, timezoneName, messageType, eventType, source, formatString, userID, 23 | activityIdentifier, subsystem, category, threadID, senderImageUUID, imageOffset, 24 | imageUUID, bootUUID, processImagePath, senderImagePath, machTimestamp, eventMessage, 25 | processImageUUID, traceID, processID, senderProgramCounter, parentActivityIdentifier 26 | ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 27 | """, 28 | ( 29 | data.get("timestamp"), 30 | data.get("timezoneName"), 31 | data.get("messageType"), 32 | data.get("eventType"), 33 | data.get("source"), 34 | data.get("formatString"), 35 | data.get("userID"), 36 | data.get("activityIdentifier"), 37 | data.get("subsystem"), 38 | data.get("category"), 39 | data.get("threadID"), 40 | data.get("senderImageUUID"), 41 | ( 42 | str(backtrace_frames[0].get("imageOffset")) 43 | if len(backtrace_frames) 44 | else None 45 | ), 46 | ( 47 | backtrace_frames[0].get("imageUUID") 48 | if len(backtrace_frames) 49 | else None 50 | ), 51 | data.get("bootUUID"), 52 | data.get("processImagePath"), 53 | data.get("senderImagePath"), 54 | str(data.get("machTimestamp")), 55 | data.get("eventMessage"), 56 | data.get("processImageUUID"), 57 | str(data.get("traceID")), 58 | str(data.get("processID")), 59 | str(data.get("senderProgramCounter")), 60 | data.get("parentActivityIdentifier"), 61 | ), 62 | ) 63 | 64 | def _convert_logs( 65 | self, logarchive_path: Path, database_file: Path, buffer_size=1024000 66 | ) -> int: 67 | # Create the database 68 | connection = sqlite3.connect(f"{database_file}") 69 | cursor = connection.cursor() 70 | 71 | # Set PRAGMA journal_mode to WAL (faster) 72 | cursor.execute("PRAGMA journal_mode=WAL;") 73 | 74 | # Values marked with "*" are numbers, but we use TEXT because sometimes 75 | # they are too large to fit in a SQLite integer value 76 | cursor.execute( 77 | """ 78 | CREATE TABLE IF NOT EXISTS system_logs ( 79 | timestamp TEXT, 80 | timezoneName TEXT, 81 | messageType TEXT, 82 | eventType TEXT, 83 | source TEXT, 84 | formatString TEXT, 85 | userID INTEGER, 86 | activityIdentifier INTEGER, 87 | subsystem TEXT, 88 | category TEXT, 89 | threadID INTEGER, 90 | senderImageUUID TEXT, 91 | imageOffset TEXT, -- * 92 | imageUUID TEXT, 93 | bootUUID TEXT, 94 | processImagePath TEXT, 95 | senderImagePath TEXT, 96 | machTimestamp TEXT, -- * 97 | eventMessage TEXT, 98 | processImageUUID TEXT, 99 | traceID TEXT, -- * 100 | processID TEXT, -- * 101 | senderProgramCounter TEXT, -- * 102 | parentActivityIdentifier INTEGER 103 | ) 104 | """ 105 | ) 106 | 107 | # Run log collect 108 | command = [ 109 | "log", 110 | "show", 111 | "--info", 112 | "--debug", 113 | "--signpost", 114 | "--style", 115 | "ndjson", 116 | "--archive", 117 | f"{logarchive_path}", 118 | ] 119 | p = self._create_shell_process(command) 120 | 121 | while True: 122 | time.sleep(0.1) 123 | 124 | lines = p.stdout.readlines(buffer_size) 125 | for line in lines: 126 | self._write_log_line(line, cursor) 127 | print(".", end="") 128 | connection.commit() 129 | 130 | if p.poll() != None: 131 | lines = p.stdout.readlines() 132 | for line in lines: 133 | self._write_log_line(line, cursor) 134 | print(".", end="") 135 | connection.commit() 136 | break 137 | 138 | print("\n\nCreating indexes...") 139 | for column in ( 140 | "timestamp", 141 | "messageType", 142 | "eventType", 143 | "userID", 144 | "activityIdentifier", 145 | "processID", 146 | "parentActivityIdentifier", 147 | ): 148 | cursor.execute(f"CREATE INDEX idx_{column} ON system_logs({column});") 149 | 150 | connection.commit() 151 | connection.close() 152 | 153 | return p.returncode 154 | 155 | def execute(self, params: Parameters) -> Report: 156 | # Prepare report 157 | report = Report(params, self, start_time=datetime.now()) 158 | report.path_details = self._gather_path_info(params.source) 159 | report.hardware_info = self._gather_hardware_info() 160 | # Write preliminary report 161 | self._write_report(report) 162 | 163 | success = self._create_temporary_image(report) 164 | if not success: 165 | return report 166 | 167 | sysdiagnose_destination = Path(self.temporary_mount) 168 | folder_name = "sysdiagnose_fuji" 169 | mount_point = self._find_mount_point(params.source) 170 | 171 | print("\nRunning sysdiagnose -> ", sysdiagnose_destination) 172 | command = [ 173 | "sysdiagnose", 174 | "-f", 175 | f"{sysdiagnose_destination}", 176 | "-A", 177 | f"{folder_name}", 178 | "-n", 179 | "-u", 180 | "-b", 181 | "-V", 182 | f"{mount_point}", 183 | ] 184 | status = self._run_status(command) 185 | 186 | if not status == 0: 187 | return report 188 | 189 | folder_path = sysdiagnose_destination / folder_name 190 | logarchive_path = folder_path / "system_logs.logarchive" 191 | database_file = sysdiagnose_destination / "system_logs.db" 192 | 193 | print("\nRunning log show -> ", logarchive_path) 194 | status = self._convert_logs(logarchive_path, database_file) 195 | 196 | if not status == 0: 197 | return report 198 | 199 | return self._dmg_and_hash(report) 200 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

Fuji: Forensic Unattended Juicy Imaging

6 | 7 |

GPL-3.0 license 8 | Latest release 9 | Downloads counter 10 | Stadium badge 11 | Donate on Ko-fi

12 | 13 |

MacOS forensic acquisition made simple

14 | 15 | 16 | 17 |
18 | 19 | 20 | ## About 21 | 22 | Fuji is a free, open source program for performing forensic acquisition of Mac 23 | computers. It should work on any modern Intel or Apple Silicon device, as it 24 | leverages standard executables provided by macOS. 25 | 26 | Fuji performs a so-called *live acquisition* (the computer must be turned on) of 27 | *logical* nature, i.e. it includes only existing files. The tool generates a DMG 28 | file that can be imported in several digital forensics programs. 29 | 30 | It is released under the terms of the GNU General Public License (version 3). 31 | 32 | 33 | ## Supporters and friends 34 | 35 | The development of Fuji is empowered by the support of: 36 | 37 | 38 | 39 | 51 | 52 |
40 |

41 | 42 | 43 | 44 |

45 |

46 | 13Cubed
47 | https://training.13cubed.com
48 | High quality digital forensics and information security training 49 |

50 |
53 | 54 | If you find my work in open source digital forensics valuable, please consider 55 | supporting it with a donation. Your contributions help sustain the development 56 | and maintenance of tools like Fuji. 57 | 58 | [![Donate on Ko-fi](https://badgen.net/static/Ko-fi/donate?color=e05958&icon=kofi&scale=2&labelColor=579fbf)](https://ko-fi.com/thelazza) 59 | 60 | 61 | ## Download the latest version 62 | 63 | You can find the **latest DMG file** on the releases page: 64 | 65 | [![Download Fuji: DMG](https://badgen.net/static/Download%20Fuji/DMG/blue?icon=apple&scale=2)][releases] 66 | 67 | 68 | ## Drive preparation 69 | 70 | Please carefully follow the installation procedure: 71 | 72 | 1. Partition your destination drive using the **exFAT** file system 73 | 2. Set the volume label as `Fuji` 74 | 3. Download and copy the universal Fuji DMG in the drive 75 | 76 | 77 | ## How to use Fuji 78 | 79 | 1. Connect the destination drive to the target Mac computer 80 | 2. Open the Fuji DMG and click on _Full Disk Access Settings.url_ 81 | 3. If the window has a "lock" icon, unlock it 82 | 4. Drag the _Fuji.app_ file on the list of authorized apps **and ensure the 83 | toggle is enabled** 84 | 5. Now you can run _Fuji.app_ 85 | 6. When prompted, insert the password for the administrator user 86 | 87 | The following video shows the entire acquisition process, step by step: 88 | 89 | 90 | 91 | 92 | 93 | _[Getting Started with Fuji - The Logical Choice for Mac Imaging](https://www.youtube.com/watch?v=9bEiizjySHA) on YouTube_ 94 | 95 | ### Important notes 96 | 97 | 1. Before starting the acquisition, you must specify on what drive(s) you want 98 | to store the temporary sparseimage and the final DMG file. Both values are 99 | `/Volumes/Fuji` by default and the _image name_ parameter will be used to make 100 | a new directory inside those locations. 101 | 102 | 2. You must not save the disk images on the same drive you are acquiring! 103 | 104 | 3. If you want to use the Rsync mode, it is recommended to **close all other 105 | applications before proceeding, especially Apple Mail,** otherwise some data 106 | might not be collected. 107 | 108 | 4. After the acquisition is completed you are free to decide if you want to 109 | delete the temporary sparseimage file, or keep it. All the data is still kept 110 | in the DMG file. 111 | 112 | 113 | ## Troubleshooting common issues 114 | 115 | ### ASR acquisition fails with "operation not permitted" 116 | 117 | First of all, ensure that Fuji is in the list of apps with _Full Disk Access_ 118 | permissions and the toggle is active. Close and re-open Fuji. 119 | 120 | If the issue persists, try to acquire the _Data_ volume instead of the root 121 | volume. It is usually called **Macintosh HD - Data** and it includes all user 122 | files, settings and installed applications. 123 | 124 | Fuji testers have reported that this generally solves the issue. 125 | 126 | ### ASR acquisition fails with error 49186 or 49197 127 | 128 | This has often been reported on macOS version 13 (Ventura). The APFS volume may 129 | need to be checked using the _First Aid_ function of Disk Utility (`fsck`). 130 | 131 | If this does not work, try acquiring the **Macintosh HD - Data** volume instead. 132 | 133 | In some extreme cases you might need to upgrade the operating system to a newer 134 | version or perform Rsync acquisition instead. 135 | 136 | The Rsync acquisition method works even on damaged file systems and can be used 137 | to acquire only a single directory instead of the whole drive. Files that cannot 138 | be read are skipped. 139 | 140 | ### Apple Mail data is not being acquired in Rsync mode 141 | 142 | Please ensure all other apps are closed, especially Apple Mail, before using the 143 | Rsync acquisition method. 144 | 145 | 146 | ## Development 147 | 148 | Fuji is developed as a Universal2 application using the **3.10 release** of 149 | Python from [Python.org][python]. 150 | 151 | You can create a virtual environment with: 152 | 153 | /usr/local/bin/python3.10 -m venv env 154 | source env/bin/activate 155 | 156 | The DMG file can be built by using the included Pyinstaller script: 157 | 158 | pip install -r requirements.txt 159 | pyinstaller Fuji.spec 160 | 161 | The build process must be executed from a computer running macOS. 162 | 163 | The README file in RTF format can be generated with pandoc: 164 | 165 | cat README.md | grep -v 'badge-chip' | pandoc -f markdown -s -o dist/README.rtf 166 | 167 | The following is a list of prerequisites if you want to modify the source code 168 | or run Fuji from source: 169 | 170 | - macOS version 11 or later 171 | - Python version 3.10 (tested with [3.10.11][python310]) 172 | 173 | 174 | ## Resources 175 | 176 | These are a few of several resources that have helped in the development of this 177 | software. Some include further reading on the topic: 178 | 179 | - The question [How do I copy a list of folders recursively, ignoring 180 | errors?][superuser_question] has a couple of interesting leads, mentioning 181 | Rsync and Ditto. 182 | - An answer to [Can I use ditto on OS X to sync two folders on the same 183 | machine?][superuser_answer] summarizes the difference between using Ditto and 184 | Rsync, taken from the following article. 185 | - The [Guide to Backing Up Mac OS X][bombich_guide] by CCC's developer Mike 186 | Bombich includes a detailed description of Ditto, Rsync and ASR (with the 187 | purpose of creating full disk backups). 188 | - [A user’s guide to Disk Images][disk_images] describes the features of sparse 189 | bundles and sparse images. 190 | 191 | 192 | [releases]: https://github.com/Lazza/Fuji/releases 193 | [python]: https://python.org 194 | [python310]: https://www.python.org/downloads/release/python-31011/ 195 | [superuser_question]: https://superuser.com/q/91556/278831 196 | [superuser_answer]: https://superuser.com/a/92142/278831 197 | [bombich_guide]: https://web.archive.org/web/20100107194426/http://www.bombich.com/mactips/image.html 198 | [disk_images]: https://eclecticlight.co/2022/07/11/a-users-guide-to-disk-images/ 199 | -------------------------------------------------------------------------------- /acquisition/abstract.py: -------------------------------------------------------------------------------- 1 | import hashlib 2 | import os 3 | import re 4 | import selectors 5 | import shlex 6 | import subprocess 7 | import sys 8 | import time 9 | from abc import ABC, abstractmethod 10 | from dataclasses import dataclass, field 11 | from datetime import datetime 12 | from pathlib import Path 13 | from subprocess import Popen 14 | from typing import IO, List, Tuple 15 | 16 | from meta import AUTHOR, VERSION 17 | from shared.utils import command_to_properties, lines_to_properties 18 | 19 | 20 | @dataclass 21 | class Parameters: 22 | case: str = "" 23 | examiner: str = "" 24 | notes: str = "" 25 | image_name: str = "Mac_Acquisition" 26 | source: Path = Path("/") 27 | tmp: Path = Path("/Volumes/Fuji") 28 | destination: Path = Path("/Volumes/Fuji") 29 | sound: bool = True 30 | 31 | 32 | @dataclass 33 | class PathDetails: 34 | path: Path 35 | is_disk: bool = True 36 | disk_sectors: int = 0 37 | disk_device: str = "" 38 | disk_parent: str = "" 39 | disk_identifier: int = 0 40 | disk_info: str = "" 41 | filesystem: str = "" 42 | 43 | 44 | @dataclass 45 | class HashedFile: 46 | path: Path 47 | md5: str = "" 48 | sha1: str = "" 49 | sha256: str = "" 50 | 51 | 52 | @dataclass 53 | class Report: 54 | parameters: Parameters 55 | method: "AcquisitionMethod" 56 | start_time: datetime = None 57 | end_time: datetime = None 58 | path_details: PathDetails = None 59 | hardware_info: str = "" 60 | success: bool = False 61 | output_files: List[Path] = field(default_factory=list) 62 | result: HashedFile = None 63 | 64 | 65 | class AcquisitionMethod(ABC): 66 | name = "Abstract method" 67 | description = "This method cannot be used directly" 68 | 69 | temporary_path: Path = None 70 | temporary_container: str = None 71 | temporary_volume: str = None 72 | temporary_mount: str = None 73 | output_path: Path = None 74 | 75 | def _limited_read(self, file: IO[str], limit: int, encoding: str) -> str: 76 | sel = selectors.DefaultSelector() 77 | sel.register(file, selectors.EVENT_READ) 78 | 79 | events = sel.select(0.125) 80 | if events: 81 | data = os.read(file.fileno(), limit) 82 | return data.decode(encoding, "ignore") 83 | else: 84 | # Timeout occurred 85 | return "" 86 | 87 | def _create_shell_process( 88 | self, arguments: List[str], awake=True, tee: Path = None 89 | ) -> Popen[str]: 90 | if awake: 91 | arguments = ["caffeinate", "-dimsu"] + arguments 92 | 93 | command = shlex.join(arguments) + " 2>&1" 94 | if tee is not None: 95 | tail = shlex.join(["tee", f"{tee}"]) 96 | command = f"{command} | {tail}" 97 | 98 | p = subprocess.Popen( 99 | command, 100 | stdout=subprocess.PIPE, 101 | shell=True, 102 | universal_newlines=True, 103 | ) 104 | return p 105 | 106 | def _run_silent(self, arguments: List[str], awake=True) -> Tuple[int, str]: 107 | # Run a process silently. Return its status code and output. 108 | if awake: 109 | arguments = ["caffeinate", "-dimsu"] + arguments 110 | 111 | p = subprocess.run(arguments, capture_output=True, universal_newlines=True) 112 | return p.returncode, p.stdout 113 | 114 | def _run_process( 115 | self, arguments: List[str], awake=True, buffer_size=1024000, tee: Path = None 116 | ) -> Tuple[int, str]: 117 | # Run a process in plain sight. Return its status code and output. 118 | p = self._create_shell_process(arguments, awake=awake, tee=tee) 119 | 120 | encoding = p.stdout.encoding 121 | output = "" 122 | while True: 123 | # Let it breathe and avoid the UI getting stuck 124 | time.sleep(0.1) 125 | out = self._limited_read(p.stdout, buffer_size, encoding) 126 | if out: 127 | sys.stdout.write(out) 128 | output = output + out 129 | 130 | if p.poll() != None: 131 | out = p.stdout.read() 132 | sys.stdout.write(out) 133 | output = output + out 134 | break 135 | 136 | return p.returncode, output 137 | 138 | def _run_status( 139 | self, arguments: List[str], awake=True, buffer_size=1024000, tee: Path = None 140 | ) -> int: 141 | # Run a process in plain sight. Return its status code. 142 | p = self._create_shell_process(arguments, awake=awake, tee=tee) 143 | 144 | encoding = p.stdout.encoding 145 | while True: 146 | # Let it breathe and avoid the UI getting stuck 147 | time.sleep(0.1) 148 | out = self._limited_read(p.stdout, buffer_size, encoding) 149 | if out: 150 | sys.stdout.write(out) 151 | 152 | if p.poll() != None: 153 | out = p.stdout.read() 154 | sys.stdout.write(out) 155 | break 156 | 157 | return p.returncode 158 | 159 | def _disk_from_device(self, device: str) -> str: 160 | if not device.startswith("/dev/disk"): 161 | return device 162 | chunk = device[9:].split("s")[0] 163 | return "/dev/disk" + chunk 164 | 165 | def _find_mount_point(self, path: Path) -> Path: 166 | path = os.path.realpath(path) 167 | while not os.path.ismount(path): 168 | path = os.path.dirname(path) 169 | return path 170 | 171 | def _gather_path_info(self, path: Path) -> PathDetails: 172 | is_disk = os.path.ismount(path) 173 | disk_stats = os.statvfs(path) 174 | sectors = int(disk_stats.f_blocks * disk_stats.f_frsize / 512) 175 | 176 | disk_device = "" 177 | if is_disk: 178 | disk_info = subprocess.check_output( 179 | ["diskutil", "info", f"{path}"], universal_newlines=True 180 | ) 181 | diskutil_info = lines_to_properties(disk_info.splitlines()) 182 | 183 | valid = "Device Node" in diskutil_info 184 | if valid: 185 | disk_device = diskutil_info["Device Node"] 186 | else: 187 | is_disk = False 188 | filesystem = diskutil_info.get("Type (Bundle)", "") 189 | else: 190 | mount_point = self._find_mount_point(path) 191 | mount_info = self._gather_path_info(mount_point) 192 | disk_device = mount_info.disk_device 193 | disk_info = mount_info.disk_info 194 | filesystem = mount_info.filesystem 195 | 196 | disk_identifier = os.stat(path).st_dev 197 | 198 | details = PathDetails( 199 | path, 200 | is_disk=is_disk, 201 | disk_sectors=sectors, 202 | disk_device=disk_device, 203 | disk_parent=self._disk_from_device(disk_device), 204 | disk_identifier=disk_identifier, 205 | disk_info=disk_info, 206 | filesystem=filesystem, 207 | ) 208 | return details 209 | 210 | def _gather_hardware_info(self) -> str: 211 | _, hardware_info = self._run_silent( 212 | [ 213 | "system_profiler", 214 | "SPSoftwareDataType", 215 | "SPHardwareDataType", 216 | "SPNVMeDataType", 217 | "SPSerialATADataType", 218 | "SPParallelATADataType", 219 | ] 220 | ) 221 | return hardware_info 222 | 223 | def _create_temporary_image(self, report: Report) -> bool: 224 | params = report.parameters 225 | output_directory = params.tmp / params.image_name 226 | output_directory.mkdir(parents=True, exist_ok=True) 227 | 228 | best_filesystem = "HFS+" 229 | if report.path_details.filesystem == "apfs": 230 | best_filesystem = "APFS" 231 | 232 | # Add a bit of extra space to ensure the destination is large enough 233 | extra_gigabyte_sectors = 2 * 10**6 234 | sectors = report.path_details.disk_sectors + extra_gigabyte_sectors 235 | self.temporary_path = output_directory / f"{params.image_name}.sparseimage" 236 | 237 | image_path: str = f"{self.temporary_path}" 238 | self.temporary_container = None 239 | self.temporary_volume = None 240 | result, output = self._run_process( 241 | [ 242 | "hdiutil", 243 | "create", 244 | "-sectors", 245 | f"{sectors}", 246 | "-fs", 247 | best_filesystem, 248 | "-volname", 249 | params.image_name, 250 | image_path, 251 | ], 252 | ) 253 | if result > 0: 254 | return False 255 | 256 | result, output = self._run_process(["hdiutil", "attach", image_path]) 257 | output_lines = output.strip().splitlines() 258 | 259 | container_lines = [ 260 | line for line in output_lines if line.startswith("/dev/disk") 261 | ] 262 | volume_lines = [line for line in container_lines if "/Volumes" in line] 263 | 264 | success = result == 0 and len(volume_lines) > 0 265 | if success: 266 | container_line = container_lines[0] 267 | parts = re.split("\s+", container_line, maxsplit=2) 268 | self.temporary_container = parts[0] 269 | 270 | mount_line = volume_lines[0] 271 | parts = re.split("\s+", mount_line, maxsplit=2) 272 | self.temporary_volume = parts[0] 273 | self.temporary_mount = parts[2] 274 | 275 | report.output_files.append(self.temporary_path) 276 | # Write preliminary report 277 | self._write_report(report) 278 | 279 | return success 280 | 281 | def _detach_temporary_image(self, delay=10, interval=5, attempts=20) -> bool: 282 | print("\nWaiting to detach temporary image...") 283 | time.sleep(delay) 284 | 285 | i = 1 286 | while True: 287 | result = self._run_status(["hdiutil", "detach", self.temporary_volume]) 288 | if result == 0: 289 | break 290 | i = i + 1 291 | if i == attempts: 292 | print("Failed to detach temporary image!") 293 | return False 294 | time.sleep(interval) 295 | 296 | # This could be automatically unmounted, we don't check for success 297 | _ = self._run_status(["hdiutil", "detach", self.temporary_container]) 298 | return True 299 | 300 | def _generate_dmg(self, report: Report) -> bool: 301 | params = report.parameters 302 | output_directory = params.destination / params.image_name 303 | output_directory.mkdir(parents=True, exist_ok=True) 304 | self.output_path = output_directory / f"{params.image_name}.dmg" 305 | 306 | print("\nConverting", self.temporary_path, "->", self.output_path) 307 | sparseimage = f"{self.temporary_path}" 308 | dmg = f"{self.output_path}" 309 | result = self._run_status( 310 | ["hdiutil", "convert", sparseimage, "-format", "UDZO", "-o", dmg] 311 | ) 312 | 313 | success = result == 0 314 | if success: 315 | report.output_files.append(self.output_path) 316 | 317 | return success 318 | 319 | def _compute_hashes(self, path: Path) -> HashedFile: 320 | print("\nHashing", path) 321 | 322 | total_size = os.stat(path).st_size 323 | amount = 0 324 | last_percent = 0 325 | chunk_size = 16 * 1024 326 | 327 | sha1 = hashlib.sha1() 328 | sha256 = hashlib.sha256() 329 | md5 = hashlib.md5() 330 | 331 | # The process needs to be caffeinated manually, because the hashing 332 | # function is done directly via our Python code. We start a caffeinate 333 | # instance with a very long duration (7 days) and terminate after the 334 | # process is completed. 335 | 336 | one_week = 60 * 60 * 24 * 7 337 | coffee = subprocess.Popen(["caffeinate", "-dimsu", "-t", f"{one_week}"]) 338 | 339 | try: 340 | with open(path, "rb") as f: 341 | while True: 342 | chunk = f.read(chunk_size) 343 | if not chunk: 344 | print("") 345 | break 346 | sha1.update(chunk) 347 | sha256.update(chunk) 348 | md5.update(chunk) 349 | 350 | amount = amount + chunk_size 351 | percent = 100 * amount // total_size 352 | if percent > last_percent: 353 | print(f"{percent}% ", end="") 354 | last_percent = percent 355 | finally: 356 | coffee.kill() 357 | 358 | result = HashedFile( 359 | path, md5=md5.hexdigest(), sha1=sha1.hexdigest(), sha256=sha256.hexdigest() 360 | ) 361 | return result 362 | 363 | def _write_report(self, report: Report) -> None: 364 | params = report.parameters 365 | output_directory = params.destination / params.image_name 366 | output_directory.mkdir(parents=True, exist_ok=True) 367 | self.output_report = output_directory / f"{params.image_name}.txt" 368 | 369 | print("\nWriting report file", self.output_report) 370 | 371 | separator = "-" * 80 372 | 373 | output_files = [] 374 | if len(report.output_files): 375 | output_files = [ 376 | separator, 377 | "Generated files:", 378 | ] + [f" - {file}" for file in report.output_files] 379 | 380 | hashes = [] 381 | if report.result: 382 | hashes = [ 383 | separator, 384 | f"Computed hashes ({report.result.path.name}):", 385 | f" - MD5: {report.result.md5}", 386 | f" - SHA1: {report.result.sha1}", 387 | f" - SHA256: {report.result.sha256}", 388 | ] 389 | 390 | with open(self.output_report, "w") as output: 391 | for line in ( 392 | [ 393 | "Fuji - Forensic Unattended Juicy Imaging", 394 | f"Version {VERSION} by {AUTHOR}", 395 | "Acquisition log", 396 | separator, 397 | f"Case name: {report.parameters.case}", 398 | f"Examiner: {report.parameters.examiner}", 399 | f"Notes: {report.parameters.notes}", 400 | separator, 401 | f"Start time: {report.start_time}", 402 | f"End time: {report.end_time}", 403 | f"Source: {report.parameters.source}", 404 | f"Acquisition method: {report.method.name}", 405 | separator, 406 | report.hardware_info, 407 | separator, 408 | "Volume:", 409 | "", 410 | report.path_details.disk_info, 411 | ] 412 | + output_files 413 | + hashes 414 | ): 415 | output.write(line + "\n") 416 | 417 | def _dmg_and_hash(self, report: Report) -> Report: 418 | result = self._detach_temporary_image() 419 | if not result: 420 | return report 421 | 422 | result = self._generate_dmg(report) 423 | if not result: 424 | return report 425 | 426 | # Compute all hashes and mark report as done 427 | report.result = self._compute_hashes(self.output_path) 428 | report.success = True 429 | report.end_time = datetime.now() 430 | 431 | self._write_report(report) 432 | 433 | print("\nAcquisition completed!") 434 | return report 435 | 436 | @abstractmethod 437 | def execute(self, params: Parameters) -> Report: 438 | pass 439 | -------------------------------------------------------------------------------- /fuji.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | import os 3 | import re 4 | import string 5 | import subprocess 6 | import sys 7 | import threading 8 | from pathlib import Path 9 | from typing import Iterable, List 10 | 11 | import humanize 12 | import wx 13 | import wx.lib.agw.hyperlink as hl 14 | 15 | from acquisition.abstract import AcquisitionMethod, Parameters 16 | from acquisition.asr import AsrMethod 17 | from acquisition.rsync import RsyncMethod 18 | from acquisition.sysdiagnose import SysdiagnoseMethod 19 | from checks.name import NameCheck 20 | from checks.folders import FoldersCheck 21 | from checks.free_space import FreeSpaceCheck 22 | from checks.network import NetworkCheck 23 | from meta import AUTHOR, HOMEPAGE, VERSION 24 | from shared.utils import command_to_properties, lines_to_properties 25 | 26 | METHODS = [AsrMethod(), RsyncMethod(), SysdiagnoseMethod()] 27 | CHECKS = [NameCheck(), FoldersCheck(), FreeSpaceCheck(), NetworkCheck()] 28 | PARAMS = Parameters() 29 | 30 | INPUT_WINDOW: "InputWindow" 31 | OVERVIEW_WINDOW: "OverviewWindow" 32 | PROCESSING_WINDOW: "ProcessingWindow" 33 | 34 | 35 | class RedirectText(object): 36 | out: wx.TextCtrl 37 | max_lines = 500 38 | 39 | def __init__(self, control: wx.TextCtrl): 40 | self.out = control 41 | 42 | def write(self, value): 43 | wx.CallAfter(self.append_shrink, value) 44 | 45 | def append_shrink(self, value): 46 | self.out.AppendText(value) 47 | lines = self.out.GetNumberOfLines() 48 | if lines > self.max_lines: 49 | delta = lines - self.max_lines 50 | position = self.out.XYToPosition(0, delta - 1) 51 | self.out.Remove(0, position) 52 | self.out.ShowPosition(self.out.GetLastPosition()) 53 | 54 | 55 | @dataclass 56 | class DiskSpaceInfo: 57 | identifier: str = "" 58 | size: int = 0 59 | used_space: int = 0 60 | free_space: int = 0 61 | mount_point: str = "" 62 | 63 | 64 | @dataclass 65 | class DeviceInfo: 66 | indent: int = 0 67 | type: str = "" 68 | name: str = "" 69 | size: str = "" 70 | identifier: str = "" 71 | status: str = "" 72 | disk_space: DiskSpaceInfo = None 73 | 74 | 75 | class DevicesWindow(wx.Frame): 76 | def _parse_stanza(self, stanza: str, mount_info: dict) -> Iterable[DeviceInfo]: 77 | lines = stanza.splitlines() 78 | first, second = lines[:2] 79 | status = "" 80 | if "(" in first: 81 | status = first.split("(")[1].split(")")[0] 82 | pivot_1 = second.index(":") + 1 83 | pivot_2 = second.index(" NAME") 84 | pivot_3 = second.index(" SIZE") 85 | pivot_4 = second.index(" IDENTIFIER") 86 | 87 | is_disk = True 88 | for line in lines[2:]: 89 | type = line[pivot_1 + 1 : pivot_2].strip() 90 | name = line[pivot_2:pivot_3].strip() 91 | size = line[pivot_3 + 1 : pivot_4].strip() 92 | identifier = line[pivot_4:].strip() 93 | if not identifier: 94 | continue 95 | indent = identifier[4:].count("s") 96 | if identifier == "-": 97 | indent = 1 98 | device_info = DeviceInfo( 99 | indent=indent, 100 | type=type, 101 | name=name, 102 | size=size, 103 | identifier=identifier, 104 | status=status if is_disk else "", 105 | disk_space=mount_info.get(identifier), 106 | ) 107 | 108 | is_disk = False 109 | yield device_info 110 | 111 | def __init__(self, parent): 112 | super().__init__(parent, title="Fuji - Drives and partitions") 113 | self.parent = parent 114 | panel = wx.Panel(self) 115 | 116 | title = wx.StaticText(panel, label="List of drives and partitions") 117 | title_font: wx.Font = title.GetFont() 118 | title_font.SetPointSize(18) 119 | title_font.SetWeight(wx.FONTWEIGHT_BOLD) 120 | title.SetFont(title_font) 121 | 122 | devices_label = wx.StaticText( 123 | panel, 124 | label="The source can be set by double-clicking on a mounted partition", 125 | ) 126 | 127 | self.list_ctrl = wx.ListCtrl(panel, style=wx.LC_REPORT | wx.BORDER_SUNKEN) 128 | self.list_ctrl.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.on_item_focused) 129 | self.list_ctrl.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.on_item_activated) 130 | 131 | mount_info = {} 132 | df_lines = subprocess.check_output(["df"], universal_newlines=True).splitlines() 133 | for line in df_lines: 134 | if not line.startswith("/dev/disk"): 135 | continue 136 | identifier, size, used, free, _, _, _, _, mount_point = re.split( 137 | "\s+", line, maxsplit=8 138 | ) 139 | short_identifier = identifier[5:] 140 | mount_info[short_identifier] = DiskSpaceInfo( 141 | identifier=identifier, 142 | size=int(size) * 512, 143 | used_space=int(used) * 512, 144 | free_space=int(free) * 512, 145 | mount_point=mount_point, 146 | ) 147 | 148 | self.devices: List[DeviceInfo] = [] 149 | 150 | diskutil_list = subprocess.check_output( 151 | ["diskutil", "list"], universal_newlines=True 152 | ) 153 | stanzas = diskutil_list.strip().split("\n\n") 154 | for stanza in stanzas: 155 | self.devices.extend(self._parse_stanza(stanza, mount_info)) 156 | 157 | # Add columns to the list control 158 | columns = [ 159 | "Identifier", 160 | "Type", 161 | "Name", 162 | "Size", 163 | "Device status", 164 | "Mount point", 165 | "Used space", 166 | ] 167 | 168 | for index, col in enumerate(columns): 169 | self.list_ctrl.InsertColumn(index, col, width=-1) 170 | 171 | self.selected_index = -1 172 | 173 | highlight = wx.Colour() 174 | highlight.SetRGBA(0x18808080) 175 | for index, line in enumerate(self.devices): 176 | mount_point = "" 177 | size_str = line.size 178 | used_str = "" 179 | if line.type in ("APFS Volume", "APFS Snapshot"): 180 | used_str = size_str 181 | size_str = "^" 182 | disk_space = line.disk_space 183 | if disk_space: 184 | mount_point = disk_space.mount_point 185 | used_str = humanize.naturalsize(disk_space.used_space) 186 | if mount_point == "/": 187 | estimated_used = humanize.naturalsize( 188 | disk_space.size - disk_space.free_space 189 | ) 190 | used_str = f"{estimated_used} (~)" 191 | 192 | index = self.list_ctrl.InsertItem( 193 | index, f"{' ' * line.indent}{line.identifier}" 194 | ) 195 | self.list_ctrl.SetItem(index, 1, line.type) 196 | self.list_ctrl.SetItem(index, 2, line.name) 197 | self.list_ctrl.SetItem(index, 3, size_str) 198 | self.list_ctrl.SetItem(index, 4, line.status) 199 | self.list_ctrl.SetItem(index, 5, mount_point) 200 | self.list_ctrl.SetItem(index, 6, used_str) 201 | self.list_ctrl.SetItemData(index, index) 202 | if f"{PARAMS.source}" == mount_point: 203 | self.list_ctrl.Select(index) 204 | self.list_ctrl.Focus(index) 205 | self.selected_index = index 206 | if index % 2: 207 | self.list_ctrl.SetItemBackgroundColour(index, highlight) 208 | if not mount_point: 209 | self.list_ctrl.SetItemTextColour(index, (128, 128, 128)) 210 | 211 | padding = 10 212 | width = padding * 4 213 | height = padding * 4 214 | for index in range(len(columns)): 215 | self.list_ctrl.SetColumnWidth(index, wx.LIST_AUTOSIZE) 216 | # Add a bit of padding 217 | padded_width = self.list_ctrl.GetColumnWidth(index) + padding 218 | padded_width = max(padded_width, 100) 219 | if index == 2: 220 | padded_width = min(padded_width, 180) 221 | self.list_ctrl.SetColumnWidth(index, padded_width) 222 | width = width + padded_width 223 | 224 | for index in range((self.list_ctrl.ItemCount)): 225 | rect: wx.Rect = self.list_ctrl.GetItemRect(index) 226 | height = height + rect.GetHeight() 227 | 228 | self.list_ctrl.SetMinSize(wx.Size(width, height)) 229 | 230 | # Add controls to the sizer 231 | vbox = wx.BoxSizer(wx.VERTICAL) 232 | vbox.Add(title, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 20) 233 | vbox.Add(devices_label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 10) 234 | vbox.Add((0, 10)) 235 | vbox.Add(self.list_ctrl, 1, wx.EXPAND | wx.ALL, border=10) 236 | panel.SetSizerAndFit(vbox) 237 | 238 | sizer = wx.GridSizer(1) 239 | sizer.Add(panel, 1, wx.EXPAND | wx.ALL) 240 | self.SetSizerAndFit(sizer) 241 | 242 | # The list control might become quite big, thus this line sets a 243 | # reasonable minimum so the window can be reduced 244 | self.SetMinSize(wx.Size(480, 240)) 245 | 246 | def _back_to_selected(self): 247 | try: 248 | self.list_ctrl.Select(self.selected_index) 249 | self.list_ctrl.Focus(self.selected_index) 250 | except: 251 | pass 252 | 253 | def on_item_focused(self, event): 254 | index = event.GetIndex() 255 | device: DeviceInfo = self.devices[index] 256 | if device.disk_space and device.disk_space.mount_point: 257 | self.selected_index = event.GetIndex() 258 | else: 259 | self._back_to_selected() 260 | 261 | def on_item_activated(self, event): 262 | index = event.GetIndex() 263 | device: DeviceInfo = self.devices[index] 264 | if device.disk_space and device.disk_space.mount_point: 265 | PARAMS.source = device.disk_space.mount_point 266 | self.parent.source_picker.SetPath(device.disk_space.mount_point) 267 | self.parent.source_picker.SetFocus() 268 | 269 | # Clean up event listeners and close 270 | self.list_ctrl.Unbind( 271 | wx.EVT_LIST_ITEM_FOCUSED, handler=self.on_item_focused 272 | ) 273 | self.list_ctrl.Unbind( 274 | wx.EVT_LIST_ITEM_ACTIVATED, handler=self.on_item_activated 275 | ) 276 | self.Close() 277 | else: 278 | self._back_to_selected() 279 | 280 | 281 | class InputWindow(wx.Frame): 282 | method: AcquisitionMethod 283 | 284 | def __init__(self): 285 | super().__init__( 286 | parent=None, 287 | title="Fuji - Forensic Unattended Juicy Imaging", 288 | size=(600, 400), 289 | style=wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX), 290 | ) 291 | self.EnableMaximizeButton(False) 292 | panel = wx.Panel(self) 293 | 294 | # Components 295 | title = wx.StaticText(panel, label="Fuji") 296 | title_font: wx.Font = title.GetFont() 297 | title_font.SetPointSize(36) 298 | title_font.SetWeight(wx.FONTWEIGHT_EXTRABOLD) 299 | title.SetFont(title_font) 300 | desc = wx.StaticText(panel, label="Forensic Unattended Juicy Imaging") 301 | desc_font: wx.Font = desc.GetFont() 302 | desc_font.SetPointSize(18) 303 | desc_font.SetWeight(wx.FONTWEIGHT_BOLD) 304 | desc.SetFont(desc_font) 305 | 306 | byline_text = wx.StaticText(panel, label=f"Version {VERSION} by {AUTHOR}") 307 | byline_link = hl.HyperLinkCtrl(panel, label=HOMEPAGE, URL=HOMEPAGE) 308 | accent = wx.Colour(181, 78, 78) 309 | byline_link.SetColours(accent, accent, accent) 310 | byline_link.SetBold(True) 311 | byline_link.UpdateLink() 312 | 313 | case_label = wx.StaticText(panel, label="Case name:") 314 | self.case_text = wx.TextCtrl(panel, value=PARAMS.case) 315 | examiner_label = wx.StaticText(panel, label="Examiner:") 316 | self.examiner_text = wx.TextCtrl(panel, value=PARAMS.examiner) 317 | notes_label = wx.StaticText(panel, label="Notes:") 318 | self.notes_text = wx.TextCtrl(panel, value=PARAMS.notes) 319 | 320 | output_label = wx.StaticText(panel, label="Image name:") 321 | self.output_text = wx.TextCtrl(panel, value=PARAMS.image_name) 322 | self.output_text.Bind(wx.EVT_CHAR, self._validate_image_name) 323 | source_label = wx.StaticText(panel, label="Source:") 324 | self.source_picker = wx.DirPickerCtrl(panel) 325 | self.source_picker.SetInitialDirectory("/") 326 | self.source_picker.SetPath(str(PARAMS.source)) 327 | # Add Devices button 328 | devices_button = wx.Button(panel, label="List of drives and partitions") 329 | devices_button.Bind(wx.EVT_BUTTON, self.on_open_devices) 330 | tmp_label = wx.StaticText(panel, label="Temp image location:") 331 | self.tmp_picker = wx.DirPickerCtrl(panel) 332 | self.tmp_picker.SetInitialDirectory("/Volumes") 333 | if os.path.isdir(PARAMS.tmp): 334 | self.tmp_picker.SetPath(str(PARAMS.tmp)) 335 | destination_label = wx.StaticText(panel, label="DMG destination:") 336 | self.tmp_picker.Bind(wx.EVT_DIRPICKER_CHANGED, self._tmp_location_changed) 337 | self.destination_picker = wx.DirPickerCtrl(panel) 338 | self.destination_picker.SetInitialDirectory("/Volumes") 339 | if os.path.isdir(PARAMS.destination): 340 | self.destination_picker.SetPath(str(PARAMS.destination)) 341 | method_label = wx.StaticText(panel, label="Acquisition method:") 342 | self.method_choice = wx.Choice(panel, choices=[m.name for m in METHODS]) 343 | self.method_choice.SetSelection(0) 344 | 345 | # Prepare method descriptions 346 | self.description_texts = [] 347 | for method in METHODS: 348 | description_label = f"{method.name}: {method.description}" 349 | description_text = wx.StaticText(panel) 350 | description_text.SetLabelMarkup(description_label) 351 | self.description_texts.append(description_text) 352 | 353 | # Sound checkbox 354 | self.sound_checkbox = wx.CheckBox( 355 | panel, label="Play loud sound when acquisition is completed" 356 | ) 357 | self.sound_checkbox.SetValue(True) 358 | 359 | # Buttons 360 | continue_btn = wx.Button(panel, label="Continue") 361 | continue_btn.Bind(wx.EVT_BUTTON, self.on_continue) 362 | 363 | # Layout 364 | vbox = wx.BoxSizer(wx.VERTICAL) 365 | vbox.Add(title, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 20) 366 | vbox.Add(desc, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 5) 367 | vbox.Add((0, 10)) 368 | 369 | vbox.Add(byline_text, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 0) 370 | vbox.Add(byline_link, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 5) 371 | vbox.Add((0, 20)) 372 | 373 | # Create a FlexGridSizer for labels and text controls 374 | case_info = wx.FlexGridSizer(cols=2, hgap=10, vgap=10) 375 | case_info.Add(case_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 376 | case_info.Add(self.case_text, 1, wx.EXPAND) 377 | case_info.Add(examiner_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 378 | case_info.Add(self.examiner_text, 1, wx.EXPAND) 379 | case_info.Add(notes_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 380 | case_info.Add(self.notes_text, 1, wx.EXPAND) 381 | case_info.AddGrowableCol(1, 1) 382 | 383 | vbox.Add(case_info, 0, wx.EXPAND | wx.ALL, 10) 384 | 385 | output_info = wx.FlexGridSizer(cols=2, hgap=10, vgap=10) 386 | output_info.Add(output_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 387 | output_info.Add(self.output_text, 1, wx.EXPAND) 388 | output_info.Add(source_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 389 | output_info.Add(self.source_picker, 1, wx.EXPAND) 390 | output_info.Add((0, 0)) 391 | output_info.Add(devices_button, 0, wx.EXPAND) 392 | output_info.Add(tmp_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 393 | output_info.Add(self.tmp_picker, 1, wx.EXPAND) 394 | output_info.Add(destination_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 395 | output_info.Add(self.destination_picker, 1, wx.EXPAND) 396 | output_info.Add(method_label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL) 397 | output_info.Add(self.method_choice, 1, wx.EXPAND) 398 | output_info.AddGrowableCol(1, 1) 399 | 400 | vbox.Add(output_info, 0, wx.EXPAND | wx.ALL, 10) 401 | 402 | for description_text in self.description_texts: 403 | vbox.Add(description_text, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 10) 404 | 405 | vbox.Add((0, 20)) 406 | vbox.Add(self.sound_checkbox, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 10) 407 | vbox.Add(continue_btn, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 20) 408 | panel.SetSizer(vbox) 409 | 410 | sizer = wx.BoxSizer(wx.VERTICAL) 411 | sizer.Add(panel) 412 | self.SetSizerAndFit(sizer) 413 | 414 | # Bind close 415 | self.Bind(wx.EVT_CLOSE, self.on_close) 416 | 417 | def on_open_devices(self, event): 418 | devices_window = DevicesWindow(self) 419 | devices_window.Show() 420 | devices_window.Move(64, 64) 421 | 422 | def on_tmp_location_changed(self, event): 423 | temp_location = self.tmp_picker.GetPath() 424 | destination_location = self.destination_picker.GetPath() 425 | if not destination_location: 426 | self.destination_picker.SetPath(temp_location) 427 | 428 | def _validate_image_name(self, event): 429 | key = event.GetKeyCode() 430 | valid_characters = "-_." + string.ascii_letters + string.digits 431 | 432 | if chr(key) in valid_characters: 433 | event.Skip() 434 | return 435 | else: 436 | return False 437 | 438 | def _tmp_location_changed(self, event): 439 | temp_location = self.tmp_picker.GetPath() 440 | destination_location = self.destination_picker.GetPath() 441 | if not destination_location: 442 | self.destination_picker.SetPath(temp_location) 443 | 444 | def on_continue(self, event): 445 | PARAMS.case = self.case_text.Value 446 | PARAMS.examiner = self.examiner_text.Value 447 | PARAMS.notes = self.notes_text.Value 448 | PARAMS.image_name = self.output_text.Value 449 | PARAMS.source = Path(self.source_picker.GetPath().strip()) 450 | PARAMS.tmp = Path(self.tmp_picker.GetPath().strip()) 451 | PARAMS.destination = Path(self.destination_picker.GetPath().strip()) 452 | PARAMS.sound = self.sound_checkbox.GetValue() 453 | self.method = METHODS[self.method_choice.GetSelection()] 454 | 455 | self.Hide() 456 | OVERVIEW_WINDOW.update_overview() 457 | OVERVIEW_WINDOW.Show() 458 | 459 | def on_close(self, event): 460 | app: wx.App = wx.GetApp() 461 | app.ExitMainLoop() 462 | 463 | 464 | class OverviewWindow(wx.Frame): 465 | def __init__(self): 466 | super().__init__( 467 | parent=None, 468 | title="Fuji - Overview", 469 | size=(800, 400), 470 | style=wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX), 471 | ) 472 | panel = wx.Panel(self) 473 | 474 | # Components 475 | title = wx.StaticText(panel, label="Acquisition overview") 476 | title_font: wx.Font = title.GetFont() 477 | title_font.SetPointSize(18) 478 | title_font.SetWeight(wx.FONTWEIGHT_BOLD) 479 | title.SetFont(title_font) 480 | 481 | # Overview grid container of 2 columns 482 | self.overview_grid = wx.FlexGridSizer(cols=2, hgap=20, vgap=10) 483 | self.overview_grid.AddGrowableCol(1, 1) 484 | 485 | # Buttons 486 | back_btn = wx.Button(panel, label="Back") 487 | back_btn.Bind(wx.EVT_BUTTON, self.on_back) 488 | confirm_btn = wx.Button(panel, label="Confirm") 489 | confirm_btn.Bind(wx.EVT_BUTTON, self.on_confirm) 490 | 491 | # Layout 492 | vbox = wx.BoxSizer(wx.VERTICAL) 493 | vbox.Add(title, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 20) 494 | vbox.Add((0, 10)) 495 | vbox.Add(self.overview_grid, 0, wx.EXPAND | wx.ALL, 10) 496 | vbox.Add((0, 20)) 497 | hbox = wx.BoxSizer(wx.HORIZONTAL) 498 | hbox.Add(back_btn, 0, wx.RIGHT, 10) 499 | hbox.Add(confirm_btn, 0) 500 | vbox.Add(hbox, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 20) 501 | 502 | panel.SetSizer(vbox) 503 | self.panel = panel 504 | 505 | # Bind close 506 | self.Bind(wx.EVT_CLOSE, self.on_close) 507 | 508 | def update_overview(self): 509 | # Clear the existing grid content 510 | self.overview_grid.Clear(True) 511 | 512 | data = { 513 | "Case name": PARAMS.case, 514 | "Examiner": PARAMS.examiner, 515 | "Notes": PARAMS.notes, 516 | "Image name": PARAMS.image_name, 517 | "Source": PARAMS.source, 518 | "Temp image location": PARAMS.tmp, 519 | "DMG destination": PARAMS.destination, 520 | "Acquisition method": INPUT_WINDOW.method.name, 521 | "Play sound": "Yes" if PARAMS.sound else "No", 522 | } 523 | 524 | max_text_width = 600 525 | 526 | # Insert rows into the grid 527 | for label, value in data.items(): 528 | label_text = wx.StaticText(self.panel, label=label) 529 | label_text_font = label_text.GetFont() 530 | label_text_font.SetWeight(wx.FONTWEIGHT_BOLD) 531 | label_text.SetFont(label_text_font) 532 | value_text = wx.StaticText( 533 | self.panel, 534 | label=f"{value}", 535 | size=(max_text_width, -1), 536 | ) 537 | value_text.Wrap(max_text_width) 538 | self.overview_grid.Add(label_text, 0, wx.ALIGN_LEFT | wx.ALIGN_TOP) 539 | self.overview_grid.Add(value_text, 1, wx.ALIGN_LEFT | wx.ALIGN_TOP) 540 | 541 | # Perform checks 542 | for check in CHECKS: 543 | result = check.execute(PARAMS) 544 | label_text = wx.StaticText(self.panel, label=check.name) 545 | label_text_font = label_text.GetFont() 546 | label_text_font.SetWeight(wx.FONTWEIGHT_BOLD) 547 | label_text.SetFont(label_text_font) 548 | if not result.passed: 549 | label_text.SetForegroundColour((240, 20, 20)) 550 | value_text = wx.StaticText( 551 | self.panel, 552 | label=result.message, 553 | size=(max_text_width, -1), 554 | ) 555 | value_text.Wrap(max_text_width) 556 | self.overview_grid.Add(label_text, 0, wx.ALIGN_LEFT | wx.ALIGN_TOP) 557 | self.overview_grid.Add(value_text, 1, wx.ALIGN_LEFT | wx.ALIGN_TOP) 558 | 559 | # Update the layout 560 | self.panel.Layout() 561 | self.panel.Fit() 562 | self.Fit() 563 | 564 | def on_back(self, event): 565 | # Hide the overview window and show the input window again 566 | self.Hide() 567 | INPUT_WINDOW.Show() 568 | 569 | def on_confirm(self, event): 570 | # Start acquisition 571 | self.Hide() 572 | PROCESSING_WINDOW.activate() 573 | 574 | def on_close(self, event): 575 | self.on_back(event) 576 | 577 | 578 | class ProcessingWindow(wx.Frame): 579 | def __init__(self): 580 | super().__init__( 581 | parent=None, 582 | title="Fuji - Acquisition", 583 | size=(800, 600), 584 | ) 585 | self.panel = wx.Panel(self) 586 | 587 | # Components 588 | self.title = wx.StaticText(self.panel, label="Acquisition in progress") 589 | self.title_font: wx.Font = self.title.GetFont() 590 | self.title_font.SetPointSize(18) 591 | self.title_font.SetWeight(wx.FONTWEIGHT_BOLD) 592 | self.title.SetFont(self.title_font) 593 | self.output_text = wx.TextCtrl( 594 | self.panel, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.VSCROLL 595 | ) 596 | 597 | # Layout 598 | vbox = wx.BoxSizer(wx.VERTICAL) 599 | vbox.Add(self.title, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.TOP, 20) 600 | vbox.Add((0, 10)) 601 | vbox.Add(self.output_text, 1, wx.EXPAND | wx.ALL, 10) 602 | 603 | self.panel.SetSizer(vbox) 604 | 605 | # Bind close 606 | self.Bind(wx.EVT_CLOSE, self.on_close) 607 | 608 | def activate(self): 609 | self.running = True 610 | 611 | # Reset initial status 612 | self.title.SetLabel("Acquisition in progress") 613 | self.title.SetForegroundColour(wx.NullColour) 614 | self.title.SetFont(self.title_font) 615 | self.output_text.SetValue("") 616 | 617 | self.Show() 618 | 619 | # Redirect sys.stdout to the custom file-like object 620 | redir = RedirectText(self.output_text) 621 | sys.stdout = redir 622 | sys.stderr = redir 623 | 624 | # Start acquisition process in a separate thread 625 | self.acquisition_thread = threading.Thread(target=self.execute_acquisition) 626 | self.acquisition_thread.start() 627 | 628 | def execute_acquisition(self): 629 | try: 630 | method = INPUT_WINDOW.method 631 | result = method.execute(PARAMS) 632 | 633 | # Process ended 634 | wx.CallAfter(self.set_completion_status, result.success) 635 | 636 | if PARAMS.sound: 637 | self.play_sound(result.success) 638 | 639 | except Exception as e: 640 | # Acquisition failed 641 | wx.CallAfter(self.set_completion_status, False) 642 | wx.CallAfter(sys.stdout.write, f"Error: {str(e)}\n") 643 | 644 | def play_sound(self, success: bool): 645 | MAX_VOLUME = 7 646 | 647 | volume_settings = subprocess.check_output( 648 | ["osascript", "-e", "get volume settings"], universal_newlines=True 649 | ) 650 | volume_properties = lines_to_properties(volume_settings.split(",")) 651 | try: 652 | current_volume = int(volume_properties.get("output volume")) 653 | except: 654 | # Keep reasonable volume 655 | current_volume = 50 656 | scaled = MAX_VOLUME * (current_volume / 100.0) 657 | rounded = round(scaled, 4) 658 | 659 | # Play the sound 660 | subprocess.call(["osascript", "-e", f"set Volume {MAX_VOLUME}"]) 661 | sound = "Glass" if success else "Basso" 662 | subprocess.call(["afplay", f"/System/Library/Sounds/{sound}.aiff"]) 663 | subprocess.call(["osascript", "-e", f"set Volume {rounded}"]) 664 | 665 | def set_completion_status(self, success): 666 | if success: 667 | self.title.SetLabel("Acquisition completed") 668 | self.title.SetForegroundColour((20, 240, 20)) 669 | else: 670 | self.title.SetLabel("Acquisition failed") 671 | self.title.SetForegroundColour((240, 20, 20)) 672 | self.title.SetFont(self.title_font) 673 | self.running = False 674 | 675 | def on_close(self, event): 676 | if not self.running: 677 | self.Hide() 678 | INPUT_WINDOW.Show() 679 | 680 | 681 | if __name__ == "__main__": 682 | # Try to find the serial number 683 | information = command_to_properties( 684 | ["ioreg", "-rd1", "-c", "IOPlatformExpertDevice"], 685 | separator="=", 686 | strip_chars='"<> ', 687 | ) 688 | if "IOPlatformSerialNumber" in information: 689 | serial_number = information["IOPlatformSerialNumber"] 690 | PARAMS.image_name = f"{serial_number}_Acquisition" 691 | 692 | app = wx.App() 693 | INPUT_WINDOW = InputWindow() 694 | OVERVIEW_WINDOW = OverviewWindow() 695 | PROCESSING_WINDOW = ProcessingWindow() 696 | 697 | INPUT_WINDOW.Show() 698 | app.MainLoop() 699 | app.Destroy() 700 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # GNU GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright (C) 2007 Free Software Foundation, Inc. 6 | 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | ## Preamble 12 | 13 | The GNU General Public License is a free, copyleft license for 14 | software and other kinds of works. 15 | 16 | The licenses for most software and other practical works are designed 17 | to take away your freedom to share and change the works. By contrast, 18 | the GNU General Public License is intended to guarantee your freedom 19 | to share and change all versions of a program--to make sure it remains 20 | free software for all its users. We, the Free Software Foundation, use 21 | the GNU General Public License for most of our software; it applies 22 | also to any other work released this way by its authors. You can apply 23 | it to your programs, too. 24 | 25 | When we speak of free software, we are referring to freedom, not 26 | price. Our General Public Licenses are designed to make sure that you 27 | have the freedom to distribute copies of free software (and charge for 28 | them if you wish), that you receive source code or can get it if you 29 | want it, that you can change the software or use pieces of it in new 30 | free programs, and that you know you can do these things. 31 | 32 | To protect your rights, we need to prevent others from denying you 33 | these rights or asking you to surrender the rights. Therefore, you 34 | have certain responsibilities if you distribute copies of the 35 | software, or if you modify it: responsibilities to respect the freedom 36 | of others. 37 | 38 | For example, if you distribute copies of such a program, whether 39 | gratis or for a fee, you must pass on to the recipients the same 40 | freedoms that you received. You must make sure that they, too, receive 41 | or can get the source code. And you must show them these terms so they 42 | know their rights. 43 | 44 | Developers that use the GNU GPL protect your rights with two steps: 45 | (1) assert copyright on the software, and (2) offer you this License 46 | giving you legal permission to copy, distribute and/or modify it. 47 | 48 | For the developers' and authors' protection, the GPL clearly explains 49 | that there is no warranty for this free software. For both users' and 50 | authors' sake, the GPL requires that modified versions be marked as 51 | changed, so that their problems will not be attributed erroneously to 52 | authors of previous versions. 53 | 54 | Some devices are designed to deny users access to install or run 55 | modified versions of the software inside them, although the 56 | manufacturer can do so. This is fundamentally incompatible with the 57 | aim of protecting users' freedom to change the software. The 58 | systematic pattern of such abuse occurs in the area of products for 59 | individuals to use, which is precisely where it is most unacceptable. 60 | Therefore, we have designed this version of the GPL to prohibit the 61 | practice for those products. If such problems arise substantially in 62 | other domains, we stand ready to extend this provision to those 63 | domains in future versions of the GPL, as needed to protect the 64 | freedom of users. 65 | 66 | Finally, every program is threatened constantly by software patents. 67 | States should not allow patents to restrict development and use of 68 | software on general-purpose computers, but in those that do, we wish 69 | to avoid the special danger that patents applied to a free program 70 | could make it effectively proprietary. To prevent this, the GPL 71 | assures that patents cannot be used to render the program non-free. 72 | 73 | The precise terms and conditions for copying, distribution and 74 | modification follow. 75 | 76 | ## TERMS AND CONDITIONS 77 | 78 | ### 0. Definitions. 79 | 80 | "This License" refers to version 3 of the GNU General Public License. 81 | 82 | "Copyright" also means copyright-like laws that apply to other kinds 83 | of works, such as semiconductor masks. 84 | 85 | "The Program" refers to any copyrightable work licensed under this 86 | License. Each licensee is addressed as "you". "Licensees" and 87 | "recipients" may be individuals or organizations. 88 | 89 | To "modify" a work means to copy from or adapt all or part of the work 90 | in a fashion requiring copyright permission, other than the making of 91 | an exact copy. The resulting work is called a "modified version" of 92 | the earlier work or a work "based on" the earlier work. 93 | 94 | A "covered work" means either the unmodified Program or a work based 95 | on the Program. 96 | 97 | To "propagate" a work means to do anything with it that, without 98 | permission, would make you directly or secondarily liable for 99 | infringement under applicable copyright law, except executing it on a 100 | computer or modifying a private copy. Propagation includes copying, 101 | distribution (with or without modification), making available to the 102 | public, and in some countries other activities as well. 103 | 104 | To "convey" a work means any kind of propagation that enables other 105 | parties to make or receive copies. Mere interaction with a user 106 | through a computer network, with no transfer of a copy, is not 107 | conveying. 108 | 109 | An interactive user interface displays "Appropriate Legal Notices" to 110 | the extent that it includes a convenient and prominently visible 111 | feature that (1) displays an appropriate copyright notice, and (2) 112 | tells the user that there is no warranty for the work (except to the 113 | extent that warranties are provided), that licensees may convey the 114 | work under this License, and how to view a copy of this License. If 115 | the interface presents a list of user commands or options, such as a 116 | menu, a prominent item in the list meets this criterion. 117 | 118 | ### 1. Source Code. 119 | 120 | The "source code" for a work means the preferred form of the work for 121 | making modifications to it. "Object code" means any non-source form of 122 | a work. 123 | 124 | A "Standard Interface" means an interface that either is an official 125 | standard defined by a recognized standards body, or, in the case of 126 | interfaces specified for a particular programming language, one that 127 | is widely used among developers working in that language. 128 | 129 | The "System Libraries" of an executable work include anything, other 130 | than the work as a whole, that (a) is included in the normal form of 131 | packaging a Major Component, but which is not part of that Major 132 | Component, and (b) serves only to enable use of the work with that 133 | Major Component, or to implement a Standard Interface for which an 134 | implementation is available to the public in source code form. A 135 | "Major Component", in this context, means a major essential component 136 | (kernel, window system, and so on) of the specific operating system 137 | (if any) on which the executable work runs, or a compiler used to 138 | produce the work, or an object code interpreter used to run it. 139 | 140 | The "Corresponding Source" for a work in object code form means all 141 | the source code needed to generate, install, and (for an executable 142 | work) run the object code and to modify the work, including scripts to 143 | control those activities. However, it does not include the work's 144 | System Libraries, or general-purpose tools or generally available free 145 | programs which are used unmodified in performing those activities but 146 | which are not part of the work. For example, Corresponding Source 147 | includes interface definition files associated with source files for 148 | the work, and the source code for shared libraries and dynamically 149 | linked subprograms that the work is specifically designed to require, 150 | such as by intimate data communication or control flow between those 151 | subprograms and other parts of the work. 152 | 153 | The Corresponding Source need not include anything that users can 154 | regenerate automatically from other parts of the Corresponding Source. 155 | 156 | The Corresponding Source for a work in source code form is that same 157 | work. 158 | 159 | ### 2. Basic Permissions. 160 | 161 | All rights granted under this License are granted for the term of 162 | copyright on the Program, and are irrevocable provided the stated 163 | conditions are met. This License explicitly affirms your unlimited 164 | permission to run the unmodified Program. The output from running a 165 | covered work is covered by this License only if the output, given its 166 | content, constitutes a covered work. This License acknowledges your 167 | rights of fair use or other equivalent, as provided by copyright law. 168 | 169 | You may make, run and propagate covered works that you do not convey, 170 | without conditions so long as your license otherwise remains in force. 171 | You may convey covered works to others for the sole purpose of having 172 | them make modifications exclusively for you, or provide you with 173 | facilities for running those works, provided that you comply with the 174 | terms of this License in conveying all material for which you do not 175 | control copyright. Those thus making or running the covered works for 176 | you must do so exclusively on your behalf, under your direction and 177 | control, on terms that prohibit them from making any copies of your 178 | copyrighted material outside their relationship with you. 179 | 180 | Conveying under any other circumstances is permitted solely under the 181 | conditions stated below. Sublicensing is not allowed; section 10 makes 182 | it unnecessary. 183 | 184 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 185 | 186 | No covered work shall be deemed part of an effective technological 187 | measure under any applicable law fulfilling obligations under article 188 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 189 | similar laws prohibiting or restricting circumvention of such 190 | measures. 191 | 192 | When you convey a covered work, you waive any legal power to forbid 193 | circumvention of technological measures to the extent such 194 | circumvention is effected by exercising rights under this License with 195 | respect to the covered work, and you disclaim any intention to limit 196 | operation or modification of the work as a means of enforcing, against 197 | the work's users, your or third parties' legal rights to forbid 198 | circumvention of technological measures. 199 | 200 | ### 4. Conveying Verbatim Copies. 201 | 202 | You may convey verbatim copies of the Program's source code as you 203 | receive it, in any medium, provided that you conspicuously and 204 | appropriately publish on each copy an appropriate copyright notice; 205 | keep intact all notices stating that this License and any 206 | non-permissive terms added in accord with section 7 apply to the code; 207 | keep intact all notices of the absence of any warranty; and give all 208 | recipients a copy of this License along with the Program. 209 | 210 | You may charge any price or no price for each copy that you convey, 211 | and you may offer support or warranty protection for a fee. 212 | 213 | ### 5. Conveying Modified Source Versions. 214 | 215 | You may convey a work based on the Program, or the modifications to 216 | produce it from the Program, in the form of source code under the 217 | terms of section 4, provided that you also meet all of these 218 | conditions: 219 | 220 | - a) The work must carry prominent notices stating that you modified 221 | it, and giving a relevant date. 222 | - b) The work must carry prominent notices stating that it is 223 | released under this License and any conditions added under 224 | section 7. This requirement modifies the requirement in section 4 225 | to "keep intact all notices". 226 | - c) You must license the entire work, as a whole, under this 227 | License to anyone who comes into possession of a copy. This 228 | License will therefore apply, along with any applicable section 7 229 | additional terms, to the whole of the work, and all its parts, 230 | regardless of how they are packaged. This License gives no 231 | permission to license the work in any other way, but it does not 232 | invalidate such permission if you have separately received it. 233 | - d) If the work has interactive user interfaces, each must display 234 | Appropriate Legal Notices; however, if the Program has interactive 235 | interfaces that do not display Appropriate Legal Notices, your 236 | work need not make them do so. 237 | 238 | A compilation of a covered work with other separate and independent 239 | works, which are not by their nature extensions of the covered work, 240 | and which are not combined with it such as to form a larger program, 241 | in or on a volume of a storage or distribution medium, is called an 242 | "aggregate" if the compilation and its resulting copyright are not 243 | used to limit the access or legal rights of the compilation's users 244 | beyond what the individual works permit. Inclusion of a covered work 245 | in an aggregate does not cause this License to apply to the other 246 | parts of the aggregate. 247 | 248 | ### 6. Conveying Non-Source Forms. 249 | 250 | You may convey a covered work in object code form under the terms of 251 | sections 4 and 5, provided that you also convey the machine-readable 252 | Corresponding Source under the terms of this License, in one of these 253 | ways: 254 | 255 | - a) Convey the object code in, or embodied in, a physical product 256 | (including a physical distribution medium), accompanied by the 257 | Corresponding Source fixed on a durable physical medium 258 | customarily used for software interchange. 259 | - b) Convey the object code in, or embodied in, a physical product 260 | (including a physical distribution medium), accompanied by a 261 | written offer, valid for at least three years and valid for as 262 | long as you offer spare parts or customer support for that product 263 | model, to give anyone who possesses the object code either (1) a 264 | copy of the Corresponding Source for all the software in the 265 | product that is covered by this License, on a durable physical 266 | medium customarily used for software interchange, for a price no 267 | more than your reasonable cost of physically performing this 268 | conveying of source, or (2) access to copy the Corresponding 269 | Source from a network server at no charge. 270 | - c) Convey individual copies of the object code with a copy of the 271 | written offer to provide the Corresponding Source. This 272 | alternative is allowed only occasionally and noncommercially, and 273 | only if you received the object code with such an offer, in accord 274 | with subsection 6b. 275 | - d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | - e) Convey the object code using peer-to-peer transmission, 288 | provided you inform other peers where the object code and 289 | Corresponding Source of the work are being offered to the general 290 | public at no charge under subsection 6d. 291 | 292 | A separable portion of the object code, whose source code is excluded 293 | from the Corresponding Source as a System Library, need not be 294 | included in conveying the object code work. 295 | 296 | A "User Product" is either (1) a "consumer product", which means any 297 | tangible personal property which is normally used for personal, 298 | family, or household purposes, or (2) anything designed or sold for 299 | incorporation into a dwelling. In determining whether a product is a 300 | consumer product, doubtful cases shall be resolved in favor of 301 | coverage. For a particular product received by a particular user, 302 | "normally used" refers to a typical or common use of that class of 303 | product, regardless of the status of the particular user or of the way 304 | in which the particular user actually uses, or expects or is expected 305 | to use, the product. A product is a consumer product regardless of 306 | whether the product has substantial commercial, industrial or 307 | non-consumer uses, unless such uses represent the only significant 308 | mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to 312 | install and execute modified versions of a covered work in that User 313 | Product from a modified version of its Corresponding Source. The 314 | information must suffice to ensure that the continued functioning of 315 | the modified object code is in no case prevented or interfered with 316 | solely because modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or 331 | updates for a work that has been modified or installed by the 332 | recipient, or for the User Product in which it has been modified or 333 | installed. Access to a network may be denied when the modification 334 | itself materially and adversely affects the operation of the network 335 | or violates the rules and protocols for communication across the 336 | network. 337 | 338 | Corresponding Source conveyed, and Installation Information provided, 339 | in accord with this section must be in a format that is publicly 340 | documented (and with an implementation available to the public in 341 | source code form), and must require no special password or key for 342 | unpacking, reading or copying. 343 | 344 | ### 7. Additional Terms. 345 | 346 | "Additional permissions" are terms that supplement the terms of this 347 | License by making exceptions from one or more of its conditions. 348 | Additional permissions that are applicable to the entire Program shall 349 | be treated as though they were included in this License, to the extent 350 | that they are valid under applicable law. If additional permissions 351 | apply only to part of the Program, that part may be used separately 352 | under those permissions, but the entire Program remains governed by 353 | this License without regard to the additional permissions. 354 | 355 | When you convey a copy of a covered work, you may at your option 356 | remove any additional permissions from that copy, or from any part of 357 | it. (Additional permissions may be written to require their own 358 | removal in certain cases when you modify the work.) You may place 359 | additional permissions on material, added by you to a covered work, 360 | for which you have or can give appropriate copyright permission. 361 | 362 | Notwithstanding any other provision of this License, for material you 363 | add to a covered work, you may (if authorized by the copyright holders 364 | of that material) supplement the terms of this License with terms: 365 | 366 | - a) Disclaiming warranty or limiting liability differently from the 367 | terms of sections 15 and 16 of this License; or 368 | - b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | - c) Prohibiting misrepresentation of the origin of that material, 372 | or requiring that modified versions of such material be marked in 373 | reasonable ways as different from the original version; or 374 | - d) Limiting the use for publicity purposes of names of licensors 375 | or authors of the material; or 376 | - e) Declining to grant rights under trademark law for use of some 377 | trade names, trademarks, or service marks; or 378 | - f) Requiring indemnification of licensors and authors of that 379 | material by anyone who conveys the material (or modified versions 380 | of it) with contractual assumptions of liability to the recipient, 381 | for any liability that these contractual assumptions directly 382 | impose on those licensors and authors. 383 | 384 | All other non-permissive additional terms are considered "further 385 | restrictions" within the meaning of section 10. If the Program as you 386 | received it, or any part of it, contains a notice stating that it is 387 | governed by this License along with a term that is a further 388 | restriction, you may remove that term. If a license document contains 389 | a further restriction but permits relicensing or conveying under this 390 | License, you may add to a covered work material governed by the terms 391 | of that license document, provided that the further restriction does 392 | not survive such relicensing or conveying. 393 | 394 | If you add terms to a covered work in accord with this section, you 395 | must place, in the relevant source files, a statement of the 396 | additional terms that apply to those files, or a notice indicating 397 | where to find the applicable terms. 398 | 399 | Additional terms, permissive or non-permissive, may be stated in the 400 | form of a separately written license, or stated as exceptions; the 401 | above requirements apply either way. 402 | 403 | ### 8. Termination. 404 | 405 | You may not propagate or modify a covered work except as expressly 406 | provided under this License. Any attempt otherwise to propagate or 407 | modify it is void, and will automatically terminate your rights under 408 | this License (including any patent licenses granted under the third 409 | paragraph of section 11). 410 | 411 | However, if you cease all violation of this License, then your license 412 | from a particular copyright holder is reinstated (a) provisionally, 413 | unless and until the copyright holder explicitly and finally 414 | terminates your license, and (b) permanently, if the copyright holder 415 | fails to notify you of the violation by some reasonable means prior to 416 | 60 days after the cessation. 417 | 418 | Moreover, your license from a particular copyright holder is 419 | reinstated permanently if the copyright holder notifies you of the 420 | violation by some reasonable means, this is the first time you have 421 | received notice of violation of this License (for any work) from that 422 | copyright holder, and you cure the violation prior to 30 days after 423 | your receipt of the notice. 424 | 425 | Termination of your rights under this section does not terminate the 426 | licenses of parties who have received copies or rights from you under 427 | this License. If your rights have been terminated and not permanently 428 | reinstated, you do not qualify to receive new licenses for the same 429 | material under section 10. 430 | 431 | ### 9. Acceptance Not Required for Having Copies. 432 | 433 | You are not required to accept this License in order to receive or run 434 | a copy of the Program. Ancillary propagation of a covered work 435 | occurring solely as a consequence of using peer-to-peer transmission 436 | to receive a copy likewise does not require acceptance. However, 437 | nothing other than this License grants you permission to propagate or 438 | modify any covered work. These actions infringe copyright if you do 439 | not accept this License. Therefore, by modifying or propagating a 440 | covered work, you indicate your acceptance of this License to do so. 441 | 442 | ### 10. Automatic Licensing of Downstream Recipients. 443 | 444 | Each time you convey a covered work, the recipient automatically 445 | receives a license from the original licensors, to run, modify and 446 | propagate that work, subject to this License. You are not responsible 447 | for enforcing compliance by third parties with this License. 448 | 449 | An "entity transaction" is a transaction transferring control of an 450 | organization, or substantially all assets of one, or subdividing an 451 | organization, or merging organizations. If propagation of a covered 452 | work results from an entity transaction, each party to that 453 | transaction who receives a copy of the work also receives whatever 454 | licenses to the work the party's predecessor in interest had or could 455 | give under the previous paragraph, plus a right to possession of the 456 | Corresponding Source of the work from the predecessor in interest, if 457 | the predecessor has it or can get it with reasonable efforts. 458 | 459 | You may not impose any further restrictions on the exercise of the 460 | rights granted or affirmed under this License. For example, you may 461 | not impose a license fee, royalty, or other charge for exercise of 462 | rights granted under this License, and you may not initiate litigation 463 | (including a cross-claim or counterclaim in a lawsuit) alleging that 464 | any patent claim is infringed by making, using, selling, offering for 465 | sale, or importing the Program or any portion of it. 466 | 467 | ### 11. Patents. 468 | 469 | A "contributor" is a copyright holder who authorizes use under this 470 | License of the Program or a work on which the Program is based. The 471 | work thus licensed is called the contributor's "contributor version". 472 | 473 | A contributor's "essential patent claims" are all patent claims owned 474 | or controlled by the contributor, whether already acquired or 475 | hereafter acquired, that would be infringed by some manner, permitted 476 | by this License, of making, using, or selling its contributor version, 477 | but do not include claims that would be infringed only as a 478 | consequence of further modification of the contributor version. For 479 | purposes of this definition, "control" includes the right to grant 480 | patent sublicenses in a manner consistent with the requirements of 481 | this License. 482 | 483 | Each contributor grants you a non-exclusive, worldwide, royalty-free 484 | patent license under the contributor's essential patent claims, to 485 | make, use, sell, offer for sale, import and otherwise run, modify and 486 | propagate the contents of its contributor version. 487 | 488 | In the following three paragraphs, a "patent license" is any express 489 | agreement or commitment, however denominated, not to enforce a patent 490 | (such as an express permission to practice a patent or covenant not to 491 | sue for patent infringement). To "grant" such a patent license to a 492 | party means to make such an agreement or commitment not to enforce a 493 | patent against the party. 494 | 495 | If you convey a covered work, knowingly relying on a patent license, 496 | and the Corresponding Source of the work is not available for anyone 497 | to copy, free of charge and under the terms of this License, through a 498 | publicly available network server or other readily accessible means, 499 | then you must either (1) cause the Corresponding Source to be so 500 | available, or (2) arrange to deprive yourself of the benefit of the 501 | patent license for this particular work, or (3) arrange, in a manner 502 | consistent with the requirements of this License, to extend the patent 503 | license to downstream recipients. "Knowingly relying" means you have 504 | actual knowledge that, but for the patent license, your conveying the 505 | covered work in a country, or your recipient's use of the covered work 506 | in a country, would infringe one or more identifiable patents in that 507 | country that you have reason to believe are valid. 508 | 509 | If, pursuant to or in connection with a single transaction or 510 | arrangement, you convey, or propagate by procuring conveyance of, a 511 | covered work, and grant a patent license to some of the parties 512 | receiving the covered work authorizing them to use, propagate, modify 513 | or convey a specific copy of the covered work, then the patent license 514 | you grant is automatically extended to all recipients of the covered 515 | work and works based on it. 516 | 517 | A patent license is "discriminatory" if it does not include within the 518 | scope of its coverage, prohibits the exercise of, or is conditioned on 519 | the non-exercise of one or more of the rights that are specifically 520 | granted under this License. You may not convey a covered work if you 521 | are a party to an arrangement with a third party that is in the 522 | business of distributing software, under which you make payment to the 523 | third party based on the extent of your activity of conveying the 524 | work, and under which the third party grants, to any of the parties 525 | who would receive the covered work from you, a discriminatory patent 526 | license (a) in connection with copies of the covered work conveyed by 527 | you (or copies made from those copies), or (b) primarily for and in 528 | connection with specific products or compilations that contain the 529 | covered work, unless you entered into that arrangement, or that patent 530 | license was granted, prior to 28 March 2007. 531 | 532 | Nothing in this License shall be construed as excluding or limiting 533 | any implied license or other defenses to infringement that may 534 | otherwise be available to you under applicable patent law. 535 | 536 | ### 12. No Surrender of Others' Freedom. 537 | 538 | If conditions are imposed on you (whether by court order, agreement or 539 | otherwise) that contradict the conditions of this License, they do not 540 | excuse you from the conditions of this License. If you cannot convey a 541 | covered work so as to satisfy simultaneously your obligations under 542 | this License and any other pertinent obligations, then as a 543 | consequence you may not convey it at all. For example, if you agree to 544 | terms that obligate you to collect a royalty for further conveying 545 | from those to whom you convey the Program, the only way you could 546 | satisfy both those terms and this License would be to refrain entirely 547 | from conveying the Program. 548 | 549 | ### 13. Use with the GNU Affero General Public License. 550 | 551 | Notwithstanding any other provision of this License, you have 552 | permission to link or combine any covered work with a work licensed 553 | under version 3 of the GNU Affero General Public License into a single 554 | combined work, and to convey the resulting work. The terms of this 555 | License will continue to apply to the part which is the covered work, 556 | but the special requirements of the GNU Affero General Public License, 557 | section 13, concerning interaction through a network will apply to the 558 | combination as such. 559 | 560 | ### 14. Revised Versions of this License. 561 | 562 | The Free Software Foundation may publish revised and/or new versions 563 | of the GNU General Public License from time to time. Such new versions 564 | will be similar in spirit to the present version, but may differ in 565 | detail to address new problems or concerns. 566 | 567 | Each version is given a distinguishing version number. If the Program 568 | specifies that a certain numbered version of the GNU General Public 569 | License "or any later version" applies to it, you have the option of 570 | following the terms and conditions either of that numbered version or 571 | of any later version published by the Free Software Foundation. If the 572 | Program does not specify a version number of the GNU General Public 573 | License, you may choose any version ever published by the Free 574 | Software Foundation. 575 | 576 | If the Program specifies that a proxy can decide which future versions 577 | of the GNU General Public License can be used, that proxy's public 578 | statement of acceptance of a version permanently authorizes you to 579 | choose that version for the Program. 580 | 581 | Later license versions may give you additional or different 582 | permissions. However, no additional obligations are imposed on any 583 | author or copyright holder as a result of your choosing to follow a 584 | later version. 585 | 586 | ### 15. Disclaimer of Warranty. 587 | 588 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 589 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 590 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 591 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 592 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 593 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 594 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 595 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR 596 | CORRECTION. 597 | 598 | ### 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR 602 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 603 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 604 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT 605 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR 606 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM 607 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 608 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 609 | 610 | ### 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | ## How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these 626 | terms. 627 | 628 | To do so, attach the following notices to the program. It is safest to 629 | attach them to the start of each source file to most effectively state 630 | the exclusion of warranty; and each file should have at least the 631 | "copyright" line and a pointer to where the full notice is found. 632 | 633 | 634 | Copyright (C) 635 | 636 | This program is free software: you can redistribute it and/or modify 637 | it under the terms of the GNU General Public License as published by 638 | the Free Software Foundation, either version 3 of the License, or 639 | (at your option) any later version. 640 | 641 | This program is distributed in the hope that it will be useful, 642 | but WITHOUT ANY WARRANTY; without even the implied warranty of 643 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 644 | GNU General Public License for more details. 645 | 646 | You should have received a copy of the GNU General Public License 647 | along with this program. If not, see . 648 | 649 | Also add information on how to contact you by electronic and paper 650 | mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands \`show w' and \`show c' should show the 661 | appropriate parts of the General Public License. Of course, your 662 | program's commands might be different; for a GUI interface, you would 663 | use an "about box". 664 | 665 | You should also get your employer (if you work as a programmer) or 666 | school, if any, to sign a "copyright disclaimer" for the program, if 667 | necessary. For more information on this, and how to apply and follow 668 | the GNU GPL, see . 669 | 670 | The GNU General Public License does not permit incorporating your 671 | program into proprietary programs. If your program is a subroutine 672 | library, you may consider it more useful to permit linking proprietary 673 | applications with the library. If this is what you want to do, use the 674 | GNU Lesser General Public License instead of this License. But first, 675 | please read . 676 | -------------------------------------------------------------------------------- /packaging/LICENSE.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}} 2 | {\colortbl;\red255\green0\blue0;\red0\green0\blue255;} 3 | \widowctrl\hyphauto 4 | 5 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 GNU GENERAL PUBLIC LICENSE\par} 6 | {\pard \ql \f0 \sa180 \li0 \fi0 Version 3, 29 June 2007\par} 7 | {\pard \ql \f0 \sa180 \li0 \fi0 Copyright \u169? 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "https://fsf.org/"}}{\fldrslt{\ul 8 | https://fsf.org/ 9 | }}} 10 | >\par} 11 | {\pard \ql \f0 \sa180 \li0 \fi0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par} 12 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 Preamble\par} 13 | {\pard \ql \f0 \sa180 \li0 \fi0 The GNU General Public License is a free, copyleft license for software and other kinds of works.\par} 14 | {\pard \ql \f0 \sa180 \li0 \fi0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par} 15 | {\pard \ql \f0 \sa180 \li0 \fi0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par} 16 | {\pard \ql \f0 \sa180 \li0 \fi0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par} 17 | {\pard \ql \f0 \sa180 \li0 \fi0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par} 18 | {\pard \ql \f0 \sa180 \li0 \fi0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par} 19 | {\pard \ql \f0 \sa180 \li0 \fi0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par} 20 | {\pard \ql \f0 \sa180 \li0 \fi0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par} 21 | {\pard \ql \f0 \sa180 \li0 \fi0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par} 22 | {\pard \ql \f0 \sa180 \li0 \fi0 The precise terms and conditions for copying, distribution and modification follow.\par} 23 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 TERMS AND CONDITIONS\par} 24 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 0. Definitions.\par} 25 | {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"This License\u8221" refers to version 3 of the GNU General Public License.\par} 26 | {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Copyright\u8221" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par} 27 | {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"The Program\u8221" refers to any copyrightable work licensed under this License. Each licensee is addressed as \u8220"you\u8221". \u8220"Licensees\u8221" and \u8220"recipients\u8221" may be individuals or organizations.\par} 28 | {\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"modify\u8221" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \u8220"modified version\u8221" of the earlier work or a work \u8220"based on\u8221" the earlier work.\par} 29 | {\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"covered work\u8221" means either the unmodified Program or a work based on the Program.\par} 30 | {\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"propagate\u8221" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par} 31 | {\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"convey\u8221" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par} 32 | {\pard \ql \f0 \sa180 \li0 \fi0 An interactive user interface displays \u8220"Appropriate Legal Notices\u8221" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par} 33 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 1. Source Code.\par} 34 | {\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"source code\u8221" for a work means the preferred form of the work for making modifications to it. \u8220"Object code\u8221" means any non-source form of a work.\par} 35 | {\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"Standard Interface\u8221" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par} 36 | {\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"System Libraries\u8221" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \u8220"Major Component\u8221", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par} 37 | {\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"Corresponding Source\u8221" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par} 38 | {\pard \ql \f0 \sa180 \li0 \fi0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par} 39 | {\pard \ql \f0 \sa180 \li0 \fi0 The Corresponding Source for a work in source code form is that same work.\par} 40 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 2. Basic Permissions.\par} 41 | {\pard \ql \f0 \sa180 \li0 \fi0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par} 42 | {\pard \ql \f0 \sa180 \li0 \fi0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par} 43 | {\pard \ql \f0 \sa180 \li0 \fi0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par} 44 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par} 45 | {\pard \ql \f0 \sa180 \li0 \fi0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par} 46 | {\pard \ql \f0 \sa180 \li0 \fi0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par} 47 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 4. Conveying Verbatim Copies.\par} 48 | {\pard \ql \f0 \sa180 \li0 \fi0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par} 49 | {\pard \ql \f0 \sa180 \li0 \fi0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par} 50 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 5. Conveying Modified Source Versions.\par} 51 | {\pard \ql \f0 \sa180 \li0 \fi0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par} 52 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par} 53 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \u8220"keep intact all notices\u8221".\par} 54 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par} 55 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\sa180\par} 56 | {\pard \ql \f0 \sa180 \li0 \fi0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \u8220"aggregate\u8221" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par} 57 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 6. Conveying Non-Source Forms.\par} 58 | {\pard \ql \f0 \sa180 \li0 \fi0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par} 59 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par} 60 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par} 61 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par} 62 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par} 63 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\sa180\par} 64 | {\pard \ql \f0 \sa180 \li0 \fi0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par} 65 | {\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"User Product\u8221" is either (1) a \u8220"consumer product\u8221", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \u8220"normally used\u8221" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par} 66 | {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Installation Information\u8221" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par} 67 | {\pard \ql \f0 \sa180 \li0 \fi0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par} 68 | {\pard \ql \f0 \sa180 \li0 \fi0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par} 69 | {\pard \ql \f0 \sa180 \li0 \fi0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par} 70 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 7. Additional Terms.\par} 71 | {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Additional permissions\u8221" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par} 72 | {\pard \ql \f0 \sa180 \li0 \fi0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par} 73 | {\pard \ql \f0 \sa180 \li0 \fi0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par} 74 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par} 75 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par} 76 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par} 77 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par} 78 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par} 79 | {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\sa180\par} 80 | {\pard \ql \f0 \sa180 \li0 \fi0 All other non-permissive additional terms are considered \u8220"further restrictions\u8221" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par} 81 | {\pard \ql \f0 \sa180 \li0 \fi0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par} 82 | {\pard \ql \f0 \sa180 \li0 \fi0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par} 83 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 8. Termination.\par} 84 | {\pard \ql \f0 \sa180 \li0 \fi0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par} 85 | {\pard \ql \f0 \sa180 \li0 \fi0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par} 86 | {\pard \ql \f0 \sa180 \li0 \fi0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par} 87 | {\pard \ql \f0 \sa180 \li0 \fi0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par} 88 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 9. Acceptance Not Required for Having Copies.\par} 89 | {\pard \ql \f0 \sa180 \li0 \fi0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par} 90 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 10. Automatic Licensing of Downstream Recipients.\par} 91 | {\pard \ql \f0 \sa180 \li0 \fi0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par} 92 | {\pard \ql \f0 \sa180 \li0 \fi0 An \u8220"entity transaction\u8221" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par} 93 | {\pard \ql \f0 \sa180 \li0 \fi0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par} 94 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 11. Patents.\par} 95 | {\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"contributor\u8221" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \u8220"contributor version\u8221".\par} 96 | {\pard \ql \f0 \sa180 \li0 \fi0 A contributor's \u8220"essential patent claims\u8221" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \u8220"control\u8221" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par} 97 | {\pard \ql \f0 \sa180 \li0 \fi0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par} 98 | {\pard \ql \f0 \sa180 \li0 \fi0 In the following three paragraphs, a \u8220"patent license\u8221" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \u8220"grant\u8221" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par} 99 | {\pard \ql \f0 \sa180 \li0 \fi0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \u8220"Knowingly relying\u8221" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par} 100 | {\pard \ql \f0 \sa180 \li0 \fi0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par} 101 | {\pard \ql \f0 \sa180 \li0 \fi0 A patent license is \u8220"discriminatory\u8221" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par} 102 | {\pard \ql \f0 \sa180 \li0 \fi0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par} 103 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 12. No Surrender of Others' Freedom.\par} 104 | {\pard \ql \f0 \sa180 \li0 \fi0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par} 105 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 13. Use with the GNU Affero General Public License.\par} 106 | {\pard \ql \f0 \sa180 \li0 \fi0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par} 107 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 14. Revised Versions of this License.\par} 108 | {\pard \ql \f0 \sa180 \li0 \fi0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par} 109 | {\pard \ql \f0 \sa180 \li0 \fi0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \u8220"or any later version\u8221" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par} 110 | {\pard \ql \f0 \sa180 \li0 \fi0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par} 111 | {\pard \ql \f0 \sa180 \li0 \fi0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par} 112 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 15. Disclaimer of Warranty.\par} 113 | {\pard \ql \f0 \sa180 \li0 \fi0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \u8220"AS IS\u8221" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par} 114 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 16. Limitation of Liability.\par} 115 | {\pard \ql \f0 \sa180 \li0 \fi0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par} 116 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 17. Interpretation of Sections 15 and 16.\par} 117 | {\pard \ql \f0 \sa180 \li0 \fi0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par} 118 | {\pard \ql \f0 \sa180 \li0 \fi0 END OF TERMS AND CONDITIONS\par} 119 | {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 How to Apply These Terms to Your New Programs\par} 120 | {\pard \ql \f0 \sa180 \li0 \fi0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par} 121 | {\pard \ql \f0 \sa180 \li0 \fi0 To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \u8220"copyright\u8221" line and a pointer to where the full notice is found.\par} 122 | {\pard \ql \f0 \sa180 \li0 \fi0 \f1 \line 123 | Copyright (C) \line 124 | \line 125 | This program is free software: you can redistribute it and/or modify\line 126 | it under the terms of the GNU General Public License as published by\line 127 | the Free Software Foundation, either version 3 of the License, or\line 128 | (at your option) any later version.\line 129 | \line 130 | This program is distributed in the hope that it will be useful,\line 131 | but WITHOUT ANY WARRANTY; without even the implied warranty of\line 132 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\line 133 | GNU General Public License for more details.\line 134 | \line 135 | You should have received a copy of the GNU General Public License\line 136 | along with this program. If not, see .\par} 137 | {\pard \ql \f0 \sa180 \li0 \fi0 Also add information on how to contact you by electronic and paper mail.\par} 138 | {\pard \ql \f0 \sa180 \li0 \fi0 If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\par} 139 | {\pard \ql \f0 \sa180 \li0 \fi0 \f1 Copyright (C) \line 140 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\line 141 | This is free software, and you are welcome to redistribute it\line 142 | under certain conditions; type `show c' for details.\par} 143 | {\pard \ql \f0 \sa180 \li0 \fi0 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an \u8220"about box\u8221".\par} 144 | {\pard \ql \f0 \sa180 \li0 \fi0 You should also get your employer (if you work as a programmer) or school, if any, to sign a \u8220"copyright disclaimer\u8221" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/"}}{\fldrslt{\ul 145 | https://www.gnu.org/licenses/ 146 | }}} 147 | >.\par} 148 | {\pard \ql \f0 \sa180 \li0 \fi0 The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/why-not-lgpl.html"}}{\fldrslt{\ul 149 | https://www.gnu.org/licenses/why-not-lgpl.html 150 | }}} 151 | >.\par} 152 | } 153 | --------------------------------------------------------------------------------