[
  {
    "path": ".github/dependabot.yml",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\n# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where the package manifests are located.\n# Please see the documentation for all configuration options:\n# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates\n\nversion: 2\nupdates:\n  - package-ecosystem: \"pip\" # See documentation for possible values\n    directory: \"/\" # Location of package manifests\n    schedule:\n      interval: \"daily\"\n"
  },
  {
    "path": ".github/workflows/checks.yml",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nname: checks\n\non: [push, pull_request, workflow_dispatch]\n\njobs:\n  ruff-check:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n\n      - name: ruff check\n        uses: astral-sh/ruff-action@v3\n\n  ruff-format:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n\n      - name: ruff check\n        uses: astral-sh/ruff-action@v3\n        with:\n          args: \"format --check --diff\"\n\n  pyright:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout repo\n        uses: actions/checkout@v4\n\n      - name: Install Poetry\n        shell: bash\n        run: pipx install poetry\n\n      - name: Set up Python\n        uses: actions/setup-python@v4\n        with:\n          cache: 'poetry'\n\n      - name: Install dependencies\n        shell: bash\n        run: poetry install\n\n      - name: Add Poetry to PATH\n        shell: bash\n        run: echo \"$(poetry env info --path)/bin\" >> $GITHUB_PATH\n\n      - name: pyright\n        uses: jakebailey/pyright-action@v2\n"
  },
  {
    "path": ".gitignore",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[codz]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\nshare/python-wheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n# PyInstaller\n#   Usually these files are written by a python script from a template\n#   before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py.cover\n.hypothesis/\n.pytest_cache/\ncover/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\ndb.sqlite3-journal\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\n.pybuilder/\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# IPython\nprofile_default/\nipython_config.py\n\n# pyenv\n#   For a library or package, you might want to ignore these files since the code is\n#   intended to run in multiple environments; otherwise, check them in:\n# .python-version\n\n# pipenv\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n#   install all needed dependencies.\n# Pipfile.lock\n\n# UV\n#   Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.\n#   This is especially recommended for binary packages to ensure reproducibility, and is more\n#   commonly ignored for libraries.\n# uv.lock\n\n# poetry\n#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.\n#   This is especially recommended for binary packages to ensure reproducibility, and is more\n#   commonly ignored for libraries.\n#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control\n# poetry.lock\n# poetry.toml\n\n# pdm\n#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.\n#   pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.\n#   https://pdm-project.org/en/latest/usage/project/#working-with-version-control\n# pdm.lock\n# pdm.toml\n.pdm-python\n.pdm-build/\n\n# pixi\n#   Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.\n# pixi.lock\n#   Pixi creates a virtual environment in the .pixi directory, just like venv module creates one\n#   in the .venv directory. It is recommended not to include this directory in version control.\n.pixi\n\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm\n__pypackages__/\n\n# Celery stuff\ncelerybeat-schedule\ncelerybeat.pid\n\n# Redis\n*.rdb\n*.aof\n*.pid\n\n# RabbitMQ\nmnesia/\nrabbitmq/\nrabbitmq-data/\n\n# ActiveMQ\nactivemq-data/\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.envrc\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Pyre type checker\n.pyre/\n\n# pytype static type analyzer\n.pytype/\n\n# Cython debug symbols\ncython_debug/\n\n# PyCharm\n#   JetBrains specific template is maintained in a separate JetBrains.gitignore that can\n#   be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore\n#   and can be added to the global gitignore or merged into this file.  For a more nuclear\n#   option (not recommended) you can uncomment the following to ignore the entire idea folder.\n# .idea/\n\n# Abstra\n#   Abstra is an AI-powered process automation framework.\n#   Ignore directories containing user credentials, local state, and settings.\n#   Learn more at https://abstra.io/docs\n.abstra/\n\n# Visual Studio Code\n#   Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore \n#   that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore\n#   and can be added to the global gitignore or merged into this file. However, if you prefer, \n#   you could uncomment the following to ignore the entire vscode folder\n.vscode/\n\n# Ruff stuff:\n.ruff_cache/\n\n# PyPI configuration file\n.pypirc\n\n# Marimo\nmarimo/_static/\nmarimo/_lsp/\n__marimo__/\n\n# Streamlit\n.streamlit/secrets.toml\n\n# aospdtgen rules\n\n# Allow lib directory\n!/aospdtgen/lib/\n\n# Ignore output folder\n/output\n"
  },
  {
    "path": "LICENSES/Apache-2.0.txt",
    "content": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n     (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n     (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n     (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n     (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n     You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# aospdtgen\n\n[![PyPI version](https://img.shields.io/pypi/v/aospdtgen)](https://pypi.org/project/aospdtgen/)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0ec14174bf9840458f27062444b1e375)](https://app.codacy.com/gh/sebaubuntu-python/aospdtgen/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n\nCreate a [LineageOS](https://github.com/LineageOS)-compatible device tree from an Android stock ROM dump (made with [dumpyara](https://github.com/SebaUbuntu/dumpyara)).\nThis script supports any Android firmware from a Treble-enabled device (Higher than Android 8.0 and with VNDK enabled, you can check it with [Treble Info](https://play.google.com/store/apps/details?id=tk.hack5.treblecheck) or with `adb shell getprop ro.treble.enabled`).\nFor pre-Treble devices please use [twrpdtgen](https://github.com/twrpdtgen/twrpdtgen).\n\nRequires Python 3.9 or greater\n\n## Installation\n\n```sh\npip install aospdtgen\n```\n\n## Instructions\n\n```\n$ python -m aospdtgen --help\nusage: python -m aospdtgen [-h] [-o OUTPUT] [--no-proprietary-files] dump_path\n\nAndroid device tree generator\n\npositional arguments:\n  dump_path             path to an Android dump made with dumpyara\n\noptions:\n  -h, --help            show this help message and exit\n  -o, --output OUTPUT   custom output folder\n  --no-proprietary-files\n                        Don't generate the proprietary files list and the\n                        extract-files script\n```\n\n## License\n\n```\n#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n```\n"
  },
  {
    "path": "REUSE.toml",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nversion = 1\nSPDX-PackageName = \"aospdtgen\"\nSPDX-PackageSupplier = \"The LineageOS Project\"\nSPDX-PackageDownloadLocation = \"https://github.com/sebaubuntu-python/aospdtgen\"\n\n[[annotations]]\npath = [\"aospdtgen/templates/*.jinja2\", \"poetry.lock\"]\nprecedence = \"aggregate\"\nSPDX-FileCopyrightText = \"The LineageOS Project\"\nSPDX-License-Identifier = \"Apache-2.0\"\n"
  },
  {
    "path": "aospdtgen/__init__.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\"\"\"aospdtgen module.\"\"\"\n\nfrom pathlib import Path\n\nfrom aospdtgen.proprietary_files.section import register_sections\n\n__version__ = \"1.2.1\"\n\nmodule_path = Path(__file__).parent\nsections_path = module_path / \"proprietary_files\" / \"sections\"\ncurrent_path = Path.cwd()\n\nregister_sections(sections_path)\n"
  },
  {
    "path": "aospdtgen/__main__.py",
    "content": "#!/usr/bin/python3\n#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.main import main\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "aospdtgen/device_tree.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom os import chmod\nfrom pathlib import Path\nfrom sebaubuntu_libs.libandroid.device_info import DeviceInfo\nfrom sebaubuntu_libs.libandroid.fstab import Fstab\nfrom sebaubuntu_libs.libandroid.partitions.partitions import Partitions\nfrom sebaubuntu_libs.libandroid.props import BuildProp\nfrom sebaubuntu_libs.liblogging import LOGI\nfrom sebaubuntu_libs.libpath import is_relative_to\nfrom sebaubuntu_libs.libreorder import strcoll_files_key\nfrom shutil import rmtree\nfrom stat import S_IRWXU, S_IRGRP, S_IROTH\nfrom typing import Any, Optional\n\nfrom aospdtgen.proprietary_files.proprietary_files_list import ProprietaryFilesList\nfrom aospdtgen.templates import render_template\nfrom aospdtgen.utils.boot_configuration import BootConfiguration\nfrom aospdtgen.utils.format_props import dump_partition_build_prop\n\n\nclass DeviceTree:\n    \"\"\"Class representing an Android device tree.\"\"\"\n\n    def __init__(self, path: Path, no_proprietary_files: bool = False):\n        \"\"\"Given a path to a dumpyara dump path, generate a device tree by parsing it.\"\"\"\n        self.path = path\n\n        LOGI(\"Figuring out partitions scheme\")\n        self.partitions = Partitions(self.path)\n\n        self.system = self.partitions.system\n        self.vendor = self.partitions.vendor\n\n        LOGI(\"Parsing build props and device info\")\n        self.build_prop = BuildProp()\n        for partition in self.partitions.get_all_partitions():\n            self.build_prop.import_props(partition.build_prop)\n        self.device_info = DeviceInfo(self.build_prop)\n\n        LOGI(\"Parsing fstab\")\n        fstabs = [\n            file\n            for file in self.vendor.files\n            if (\n                is_relative_to(file.relative_to(self.vendor.path), \"etc\")\n                and file.name.startswith(\"fstab.\")\n            )\n        ]\n        assert fstabs, \"No fstab found\"\n        fstab = fstabs[0]\n        self.fstab = Fstab(fstab)\n\n        # Let the partitions know their fstab entries if any\n        for partition in self.partitions.get_all_partitions():\n            partition.fill_fstab_entry(self.fstab)\n\n        LOGI(\"Extracting boot image\")\n        self.boot_configuration = BootConfiguration(self.path)\n\n        LOGI(\"Getting list of rootdir files\")\n        self.rootdir_bin_files = [\n            file\n            for file in self.vendor.files\n            if is_relative_to(file.relative_to(self.vendor.path), \"bin\") and file.suffix == \".sh\"\n        ]\n        self.rootdir_bin_files.sort(key=strcoll_files_key)\n\n        self.rootdir_etc_files = [\n            file\n            for file in self.vendor.files\n            if is_relative_to(file.relative_to(self.vendor.path), \"etc/init/hw\")\n        ]\n        self.rootdir_etc_files.sort(key=strcoll_files_key)\n\n        recovery_resources_location = (\n            self.boot_configuration.recovery_aik_manager.ramdisk_path\n            if self.boot_configuration.recovery_aik_manager\n            else self.boot_configuration.boot_aik_manager.ramdisk_path\n        )\n        self.rootdir_recovery_etc_files = [\n            file\n            for file in recovery_resources_location.iterdir()\n            if is_relative_to(file.relative_to(recovery_resources_location), \".\")\n            and file.suffix == \".rc\"\n        ]\n        self.rootdir_recovery_etc_files.sort(key=strcoll_files_key)\n\n        self.proprietary_files_list: Optional[ProprietaryFilesList] = None\n        if not no_proprietary_files:\n            LOGI(\"Generating proprietary files list\")\n            self.proprietary_files_list = ProprietaryFilesList(\n                [value for value in self.partitions.get_all_partitions()]\n            )\n\n    def dump_to_folder(self, folder: Path):\n        \"\"\"Dump all makefiles, blueprint and prebuilts to a folder.\"\"\"\n        if folder.is_dir():\n            rmtree(folder)\n        folder.mkdir(parents=True)\n\n        # Makefiles/blueprints\n        self._render_template(folder, \"Android.bp\", comment_prefix=\"//\")\n        self._render_template(folder, \"Android.mk\")\n        self._render_template(folder, \"AndroidProducts.mk\")\n        self._render_template(folder, \"BoardConfig.mk\")\n        self._render_template(folder, \"device.mk\")\n        self._render_template(\n            folder, \"lineage_device.mk\", out_file=f\"lineage_{self.device_info.codename}.mk\"\n        )\n        self._render_template(folder, \"README.md\")\n\n        # Proprietary files list and extract utils\n        if self.proprietary_files_list:\n            self._render_template(folder, \"extract-files.py\")\n            self._render_template(folder, \"setup-makefiles.py\")\n            chmod(folder / \"extract-files.py\", S_IRWXU | S_IRGRP | S_IROTH)\n            chmod(folder / \"setup-makefiles.py\", S_IRWXU | S_IRGRP | S_IROTH)\n\n            (folder / \"proprietary-files.txt\").write_text(\n                self.proprietary_files_list.get_formatted_list(self.device_info.build_description),\n                encoding=\"utf-8\",\n            )\n\n        # Dump build props\n        for partition in self.partitions.get_all_partitions():\n            dump_partition_build_prop(partition.build_prop, folder / f\"{partition.model.name}.prop\")\n\n        # Dump boot image prebuilt files\n        prebuilts_path = folder / \"prebuilts\"\n        prebuilts_path.mkdir()\n\n        self.boot_configuration.copy_files_to_folder(prebuilts_path)\n\n        # Dump rootdir\n        rootdir_path = folder / \"rootdir\"\n        rootdir_path.mkdir()\n\n        self._render_template(rootdir_path, \"rootdir_Android.bp\", \"Android.bp\", comment_prefix=\"//\")\n        self._render_template(rootdir_path, \"rootdir_Android.mk\", \"Android.mk\")\n\n        # rootdir/bin\n        rootdir_bin_path = rootdir_path / \"bin\"\n        rootdir_bin_path.mkdir()\n\n        for file in self.rootdir_bin_files:\n            (rootdir_bin_path / file.name).write_bytes(file.read_bytes())\n\n        # rootdir/etc\n        rootdir_etc_path = rootdir_path / \"etc\"\n        rootdir_etc_path.mkdir()\n\n        for file in self.rootdir_etc_files + self.rootdir_recovery_etc_files:\n            (rootdir_etc_path / file.name).write_bytes(file.read_bytes())\n\n        (rootdir_etc_path / self.fstab.fstab.name).write_text(self.fstab.format(), encoding=\"utf-8\")\n\n        # Manifest\n        (folder / \"manifest.xml\").write_text(str(self.vendor.manifest), encoding=\"utf-8\")\n\n    def cleanup(self) -> None:\n        \"\"\"\n        Cleanup all the temporary files.\n\n        After you call this, you should throw away this object and never use it anymore.\n        \"\"\"\n        self.boot_configuration.cleanup()\n\n    def _render_template(\n        self,\n        *args: Any,\n        comment_prefix: str = \"#\",\n        **kwargs: Any,\n    ):\n        return render_template(\n            *args,\n            boot_configuration=self.boot_configuration,\n            comment_prefix=comment_prefix,\n            device_info=self.device_info,\n            fstab=self.fstab,\n            proprietary_files_list=self.proprietary_files_list,\n            rootdir_bin_files=self.rootdir_bin_files,\n            rootdir_etc_files=self.rootdir_etc_files,\n            rootdir_recovery_etc_files=self.rootdir_recovery_etc_files,\n            partitions=self.partitions,\n            **kwargs,\n        )\n"
  },
  {
    "path": "aospdtgen/main.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom argparse import ArgumentParser\nfrom pathlib import Path\nfrom sebaubuntu_libs.liblocale import setup_locale\nfrom sebaubuntu_libs.liblogging import setup_logging\n\nfrom aospdtgen import current_path\nfrom aospdtgen.device_tree import DeviceTree\n\n\ndef main():\n    setup_logging()\n\n    parser = ArgumentParser(description=\"Android device tree generator\")\n    parser.add_argument(\"dump_path\", type=Path, help=\"path to an Android dump made with dumpyara\")\n    parser.add_argument(\n        \"-o\", \"--output\", type=Path, default=current_path / \"output\", help=\"custom output folder\"\n    )\n    parser.add_argument(\n        \"--no-proprietary-files\",\n        action=\"store_true\",\n        help=\"Don't generate the proprietary files list and the extract-files script\",\n    )\n\n    args = parser.parse_args()\n\n    setup_locale()\n\n    dump = DeviceTree(args.dump_path, no_proprietary_files=args.no_proprietary_files)\n    dump.dump_to_folder(args.output)\n    dump.cleanup()\n\n    print(f\"\\nDone! You can find the device tree in {str(args.output)}\")\n"
  },
  {
    "path": "aospdtgen/proprietary_files/elf.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nfrom typing import List\n\n\ndef get_shared_libs(files: List[Path]):\n    for lib in files:\n        if not lib.suffix == \".so\":\n            continue\n\n        yield lib\n"
  },
  {
    "path": "aospdtgen/proprietary_files/get_vndk_libs.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom base64 import b64decode\nfrom typing import List, Set\nfrom requests import get\n\nfrom aospdtgen.proprietary_files.ignore import IGNORE_SHARED_LIBS\n\nARCHS = [\n    \"arm\",\n    \"arm64\",\n    \"x86\",\n    \"x86_64\",\n]\n\nFIRST_VNDK_VERSION = 29\n\n# VNDK version, architecture, file name\nFROZEN_VNDK_LIST_URL = (\n    \"https://android.googlesource.com/platform/prebuilts/vndk/v{}/+/main/{}/configs/{}?format=TEXT\"\n)\n\n# VNDK version\nGSI_VNDK_LIST_URL = (\n    \"https://android.googlesource.com/platform/build/+/main/target/product/gsi/{}.txt?format=TEXT\"\n)\n\n\ndef get_vndk_file_names(vndk_version: int) -> List[str]:\n    return [\n        \"llndk.libraries.txt\",\n        f\"vndkcore.libraries.{vndk_version}.txt\",\n        f\"vndkprivate.libraries.{vndk_version}.txt\",\n        \"vndkproduct.libraries.txt\",\n        \"vndksp.libraries.txt\",\n    ]\n\n\ndef main():\n    libs: Set[str] = set()\n\n    # Add the currently known shared libraries\n    libs.update(IGNORE_SHARED_LIBS)\n\n    current_vndk_version = FIRST_VNDK_VERSION\n    while True:\n        print(f\"Fetching VNDK libraries for version {current_vndk_version}\")\n\n        found_something = False\n\n        # Get the GSI VNDK list\n        response = get(GSI_VNDK_LIST_URL.format(current_vndk_version))\n        if response.ok:\n            found_something = True\n\n            # We only need the library name\n            for line in b64decode(response.content).decode(\"ascii\").splitlines():\n                lib = line.split()[-1]\n                libs.add(lib)\n\n        # Now get the VNDK list for each architecture\n        for arch in ARCHS:\n            for file in get_vndk_file_names(current_vndk_version):\n                response = get(FROZEN_VNDK_LIST_URL.format(current_vndk_version, arch, file))\n                if response.ok:\n                    found_something = True\n\n                    for line in b64decode(response.content).decode(\"ascii\").splitlines():\n                        libs.add(line)\n\n        if not found_something:\n            if current_vndk_version == FIRST_VNDK_VERSION:\n                raise Exception(\n                    \"Failed to fetch the GSI VNDK list for\"\n                    f\" version {current_vndk_version}, Google dropped it?\"\n                )\n\n            print(f\"Failed to fetch the VNDK list for version {current_vndk_version}, stopping\")\n\n            break\n\n        current_vndk_version += 1\n\n    # Print the list of libraries\n    print(\"\\n\".join(f'\"{lib}\",' for lib in sorted(libs)))\n\n\nmain()\n"
  },
  {
    "path": "aospdtgen/proprietary_files/ignore.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nimport re\nfrom sebaubuntu_libs.libstring import removeprefix\n\nIGNORE_BINARIES = (\n    [\n        \"awk\",  # https://cs.android.com/android/platform/superproject/main/+/main:external/one-true-awk/Android.bp\n        \"logwrapper\",  # https://cs.android.com/android/platform/superproject/main/+/main:system/logging/logwrapper/Android.bp\n        \"newfs_msdos\",  # https://cs.android.com/android/platform/superproject/main/+/main:external/newfs_msdos/Android.bp\n        \"sh\",\n        \"vndservice\",  # https://cs.android.com/android/platform/superproject/main/+/main:frameworks/native/cmds/service/Android.bp\n        \"vndservicemanager\",  # https://cs.android.com/android/platform/superproject/main/+/main:frameworks/native/cmds/servicemanager/Android.bp\n    ]\n    + [\n        # toolbox\n        \"toolbox\",\n        \"toolbox_vendor\",\n    ]\n    + [\n        # toolbox symlinks\n        # https://cs.android.com/android/platform/superproject/main/+/main:system/core/toolbox/Android.bp\n        \"getevent\",\n        \"getprop\",\n        \"modprobe\",\n        \"setprop\",\n        \"start\",\n        \"stop\",\n    ]\n    + [\n        # toybox\n        \"toybox\",\n        \"toybox_vendor\",\n    ]\n    + [\n        # toybox symlinks\n        # https://cs.android.com/android/platform/superproject/main/+/main:external/toybox/Android.bp\n        \"[\",\n        \"acpi\",\n        \"base64\",\n        \"basename\",\n        \"blockdev\",\n        \"brctl\",\n        \"cal\",\n        \"cat\",\n        \"chattr\",\n        \"chcon\",\n        \"chgrp\",\n        \"chmod\",\n        \"chown\",\n        \"chroot\",\n        \"chrt\",\n        \"cksum\",\n        \"clear\",\n        \"cmp\",\n        \"comm\",\n        \"cp\",\n        \"cpio\",\n        \"cut\",\n        \"date\",\n        \"dd\",\n        \"devmem\",\n        \"df\",\n        \"diff\",\n        \"dirname\",\n        \"dmesg\",\n        \"dos2unix\",\n        \"du\",\n        \"echo\",\n        \"egrep\",\n        \"env\",\n        \"expand\",\n        \"expr\",\n        \"fallocate\",\n        \"false\",\n        \"fgrep\",\n        \"file\",\n        \"find\",\n        \"flock\",\n        \"fmt\",\n        \"free\",\n        \"fsync\",\n        \"getconf\",\n        \"getenforce\",\n        \"gpiodetect\",\n        \"gpiofind\",\n        \"gpioget\",\n        \"gpioinfo\",\n        \"gpioset\",\n        \"grep\",\n        \"groups\",\n        \"gunzip\",\n        \"gzip\",\n        \"head\",\n        \"hostname\",\n        \"hwclock\",\n        \"i2cdetect\",\n        \"i2cdump\",\n        \"i2cget\",\n        \"i2cset\",\n        \"i2ctransfer\",\n        \"iconv\",\n        \"id\",\n        \"ifconfig\",\n        \"inotifyd\",\n        \"insmod\",\n        \"install\",\n        \"ionice\",\n        \"iorenice\",\n        \"kill\",\n        \"killall\",\n        \"ln\",\n        \"load_policy\",\n        \"log\",\n        \"logger\",\n        \"logname\",\n        \"losetup\",\n        \"ls\",\n        \"lsattr\",\n        \"lsmod\",\n        \"lsof\",\n        \"lspci\",\n        \"lsusb\",\n        \"md5sum\",\n        \"memeater\",\n        \"microcom\",\n        \"mkdir\",\n        \"mkfifo\",\n        \"mknod\",\n        \"mkswap\",\n        \"mktemp\",\n        \"modinfo\",\n        \"more\",\n        \"mount\",\n        \"mountpoint\",\n        \"mv\",\n        \"nc\",\n        \"netcat\",\n        \"netstat\",\n        \"nice\",\n        \"nl\",\n        \"nohup\",\n        \"nproc\",\n        \"nsenter\",\n        \"od\",\n        \"paste\",\n        \"patch\",\n        \"pgrep\",\n        \"pidof\",\n        \"pkill\",\n        \"pmap\",\n        \"printenv\",\n        \"printf\",\n        \"ps\",\n        \"pwd\",\n        \"readelf\",\n        \"readlink\",\n        \"realpath\",\n        \"renice\",\n        \"restorecon\",\n        \"rm\",\n        \"rmdir\",\n        \"rmmod\",\n        \"rtcwake\",\n        \"runcon\",\n        \"sed\",\n        \"sendevent\",\n        \"seq\",\n        \"setenforce\",\n        \"setsid\",\n        \"sha1sum\",\n        \"sha224sum\",\n        \"sha256sum\",\n        \"sha384sum\",\n        \"sha512sum\",\n        \"sleep\",\n        \"sort\",\n        \"split\",\n        \"stat\",\n        \"strings\",\n        \"stty\",\n        \"swapoff\",\n        \"swapon\",\n        \"sync\",\n        \"sysctl\",\n        \"tac\",\n        \"tail\",\n        \"tar\",\n        \"taskset\",\n        \"tee\",\n        \"test\",\n        \"time\",\n        \"timeout\",\n        \"top\",\n        \"touch\",\n        \"tr\",\n        \"true\",\n        \"truncate\",\n        \"tty\",\n        \"uclampset\",\n        \"ulimit\",\n        \"umount\",\n        \"uname\",\n        \"uniq\",\n        \"unix2dos\",\n        \"unlink\",\n        \"unshare\",\n        \"uptime\",\n        \"usleep\",\n        \"uudecode\",\n        \"uuencode\",\n        \"uuidgen\",\n        \"vi\",\n        \"vmstat\",\n        \"watch\",\n        \"wc\",\n        \"which\",\n        \"whoami\",\n        \"xargs\",\n        \"xxd\",\n        \"yes\",\n        \"zcat\",\n    ]\n)\n\n\"\"\"\nUse get_vndk_libs.py to update this list\n\"\"\"\nIGNORE_SHARED_LIBS = [\n    \"android.frameworks.automotive.display@1.0.so\",\n    \"android.frameworks.cameraservice.common-V1-ndk.so\",\n    \"android.frameworks.cameraservice.common@2.0.so\",\n    \"android.frameworks.cameraservice.device-V1-ndk.so\",\n    \"android.frameworks.cameraservice.device@2.0.so\",\n    \"android.frameworks.cameraservice.service-V1-ndk.so\",\n    \"android.frameworks.cameraservice.service@2.0.so\",\n    \"android.frameworks.cameraservice.service@2.1.so\",\n    \"android.frameworks.displayservice@1.0.so\",\n    \"android.frameworks.schedulerservice@1.0.so\",\n    \"android.frameworks.sensorservice@1.0.so\",\n    \"android.frameworks.stats@1.0.so\",\n    \"android.frameworks.vr.composer@1.0.so\",\n    \"android.hardware.atrace@1.0.so\",\n    \"android.hardware.audio.common-V1-ndk.so\",\n    \"android.hardware.audio.common@2.0.so\",\n    \"android.hardware.audio.common@4.0.so\",\n    \"android.hardware.audio.common@5.0.so\",\n    \"android.hardware.audio.common@6.0.so\",\n    \"android.hardware.audio.effect@2.0.so\",\n    \"android.hardware.audio.effect@4.0.so\",\n    \"android.hardware.audio.effect@5.0.so\",\n    \"android.hardware.audio.effect@6.0.so\",\n    \"android.hardware.audio@2.0.so\",\n    \"android.hardware.audio@4.0.so\",\n    \"android.hardware.audio@5.0.so\",\n    \"android.hardware.audio@6.0.so\",\n    \"android.hardware.authsecret-V1-ndk.so\",\n    \"android.hardware.authsecret-V1-ndk_platform.so\",\n    \"android.hardware.authsecret@1.0.so\",\n    \"android.hardware.automotive.audiocontrol@1.0.so\",\n    \"android.hardware.automotive.audiocontrol@2.0.so\",\n    \"android.hardware.automotive.can@1.0.so\",\n    \"android.hardware.automotive.evs@1.0.so\",\n    \"android.hardware.automotive.evs@1.1.so\",\n    \"android.hardware.automotive.occupant_awareness-V1-ndk.so\",\n    \"android.hardware.automotive.occupant_awareness-V1-ndk_platform.so\",\n    \"android.hardware.automotive.sv@1.0.so\",\n    \"android.hardware.automotive.vehicle@2.0.so\",\n    \"android.hardware.biometrics.face@1.0.so\",\n    \"android.hardware.biometrics.fingerprint@2.1.so\",\n    \"android.hardware.biometrics.fingerprint@2.2.so\",\n    \"android.hardware.bluetooth.a2dp@1.0.so\",\n    \"android.hardware.bluetooth.audio-V2-ndk.so\",\n    \"android.hardware.bluetooth.audio@2.0.so\",\n    \"android.hardware.bluetooth@1.0.so\",\n    \"android.hardware.bluetooth@1.1.so\",\n    \"android.hardware.boot@1.0.so\",\n    \"android.hardware.boot@1.1.so\",\n    \"android.hardware.broadcastradio@1.0.so\",\n    \"android.hardware.broadcastradio@1.1.so\",\n    \"android.hardware.broadcastradio@2.0.so\",\n    \"android.hardware.camera.common-V1-ndk.so\",\n    \"android.hardware.camera.common@1.0.so\",\n    \"android.hardware.camera.device-V1-ndk.so\",\n    \"android.hardware.camera.device@1.0.so\",\n    \"android.hardware.camera.device@3.2.so\",\n    \"android.hardware.camera.device@3.3.so\",\n    \"android.hardware.camera.device@3.4.so\",\n    \"android.hardware.camera.device@3.5.so\",\n    \"android.hardware.camera.device@3.6.so\",\n    \"android.hardware.camera.metadata-V1-ndk.so\",\n    \"android.hardware.camera.metadata@3.2.so\",\n    \"android.hardware.camera.metadata@3.3.so\",\n    \"android.hardware.camera.metadata@3.4.so\",\n    \"android.hardware.camera.metadata@3.5.so\",\n    \"android.hardware.camera.provider-V1-ndk.so\",\n    \"android.hardware.camera.provider@2.4.so\",\n    \"android.hardware.camera.provider@2.5.so\",\n    \"android.hardware.camera.provider@2.6.so\",\n    \"android.hardware.cas.native@1.0.so\",\n    \"android.hardware.cas@1.0.so\",\n    \"android.hardware.cas@1.1.so\",\n    \"android.hardware.cas@1.2.so\",\n    \"android.hardware.common-V1-ndk_platform.so\",\n    \"android.hardware.common-V2-ndk.so\",\n    \"android.hardware.common-V2-ndk_platform.so\",\n    \"android.hardware.common.fmq-V1-ndk.so\",\n    \"android.hardware.common.fmq-V1-ndk_platform.so\",\n    \"android.hardware.configstore-utils.so\",\n    \"android.hardware.configstore@1.0.so\",\n    \"android.hardware.configstore@1.1.so\",\n    \"android.hardware.confirmationui-support-lib.so\",\n    \"android.hardware.confirmationui@1.0.so\",\n    \"android.hardware.contexthub@1.0.so\",\n    \"android.hardware.contexthub@1.1.so\",\n    \"android.hardware.drm-V1-ndk.so\",\n    \"android.hardware.drm@1.0.so\",\n    \"android.hardware.drm@1.1.so\",\n    \"android.hardware.drm@1.2.so\",\n    \"android.hardware.drm@1.3.so\",\n    \"android.hardware.dumpstate-V1-ndk.so\",\n    \"android.hardware.dumpstate@1.0.so\",\n    \"android.hardware.dumpstate@1.1.so\",\n    \"android.hardware.fastboot@1.0.so\",\n    \"android.hardware.gatekeeper@1.0.so\",\n    \"android.hardware.gnss-V1-ndk_platform.so\",\n    \"android.hardware.gnss-V2-ndk.so\",\n    \"android.hardware.gnss.measurement_corrections@1.0.so\",\n    \"android.hardware.gnss.measurement_corrections@1.1.so\",\n    \"android.hardware.gnss.visibility_control@1.0.so\",\n    \"android.hardware.gnss@1.0.so\",\n    \"android.hardware.gnss@1.1.so\",\n    \"android.hardware.gnss@2.0.so\",\n    \"android.hardware.gnss@2.1.so\",\n    \"android.hardware.graphics.allocator-V1-ndk.so\",\n    \"android.hardware.graphics.allocator-V2-ndk.so\",\n    \"android.hardware.graphics.allocator@2.0.so\",\n    \"android.hardware.graphics.allocator@3.0.so\",\n    \"android.hardware.graphics.allocator@4.0.so\",\n    \"android.hardware.graphics.bufferqueue@1.0.so\",\n    \"android.hardware.graphics.bufferqueue@2.0.so\",\n    \"android.hardware.graphics.common-V1-ndk_platform.so\",\n    \"android.hardware.graphics.common-V2-ndk_platform.so\",\n    \"android.hardware.graphics.common-V3-ndk.so\",\n    \"android.hardware.graphics.common-V4-ndk.so\",\n    \"android.hardware.graphics.common@1.0.so\",\n    \"android.hardware.graphics.common@1.1.so\",\n    \"android.hardware.graphics.common@1.2.so\",\n    \"android.hardware.graphics.composer3-V1-ndk.so\",\n    \"android.hardware.graphics.composer@2.1.so\",\n    \"android.hardware.graphics.composer@2.2.so\",\n    \"android.hardware.graphics.composer@2.3.so\",\n    \"android.hardware.graphics.composer@2.4.so\",\n    \"android.hardware.graphics.mapper@2.0.so\",\n    \"android.hardware.graphics.mapper@2.1.so\",\n    \"android.hardware.graphics.mapper@3.0.so\",\n    \"android.hardware.graphics.mapper@4.0.so\",\n    \"android.hardware.health-V1-ndk.so\",\n    \"android.hardware.health.storage-V1-ndk.so\",\n    \"android.hardware.health.storage-V1-ndk_platform.so\",\n    \"android.hardware.health.storage@1.0.so\",\n    \"android.hardware.health@1.0.so\",\n    \"android.hardware.health@2.0.so\",\n    \"android.hardware.health@2.1.so\",\n    \"android.hardware.identity-V2-ndk_platform.so\",\n    \"android.hardware.identity-V3-ndk_platform.so\",\n    \"android.hardware.identity-V4-ndk.so\",\n    \"android.hardware.input.classifier@1.0.so\",\n    \"android.hardware.input.common@1.0.so\",\n    \"android.hardware.ir-V1-ndk.so\",\n    \"android.hardware.ir@1.0.so\",\n    \"android.hardware.keymaster-V2-ndk_platform.so\",\n    \"android.hardware.keymaster-V3-ndk.so\",\n    \"android.hardware.keymaster-V3-ndk_platform.so\",\n    \"android.hardware.keymaster@3.0.so\",\n    \"android.hardware.keymaster@4.0.so\",\n    \"android.hardware.keymaster@4.1.so\",\n    \"android.hardware.light-V1-ndk_platform.so\",\n    \"android.hardware.light-V2-ndk.so\",\n    \"android.hardware.light@2.0.so\",\n    \"android.hardware.media.bufferpool@1.0.so\",\n    \"android.hardware.media.bufferpool@2.0.so\",\n    \"android.hardware.media.c2@1.0.so\",\n    \"android.hardware.media.c2@1.1.so\",\n    \"android.hardware.media.omx@1.0.so\",\n    \"android.hardware.media@1.0.so\",\n    \"android.hardware.memtrack-V1-ndk.so\",\n    \"android.hardware.memtrack-V1-ndk_platform.so\",\n    \"android.hardware.memtrack@1.0.so\",\n    \"android.hardware.neuralnetworks@1.0.so\",\n    \"android.hardware.neuralnetworks@1.1.so\",\n    \"android.hardware.neuralnetworks@1.2.so\",\n    \"android.hardware.neuralnetworks@1.3.so\",\n    \"android.hardware.nfc-V1-ndk.so\",\n    \"android.hardware.nfc@1.0.so\",\n    \"android.hardware.nfc@1.1.so\",\n    \"android.hardware.nfc@1.2.so\",\n    \"android.hardware.oemlock-V1-ndk.so\",\n    \"android.hardware.oemlock-V1-ndk_platform.so\",\n    \"android.hardware.oemlock@1.0.so\",\n    \"android.hardware.power-V1-ndk_platform.so\",\n    \"android.hardware.power-V2-ndk_platform.so\",\n    \"android.hardware.power-V3-ndk.so\",\n    \"android.hardware.power.stats-V1-ndk.so\",\n    \"android.hardware.power.stats-V1-ndk_platform.so\",\n    \"android.hardware.power.stats@1.0.so\",\n    \"android.hardware.power@1.0.so\",\n    \"android.hardware.power@1.1.so\",\n    \"android.hardware.power@1.2.so\",\n    \"android.hardware.power@1.3.so\",\n    \"android.hardware.radio-V1-ndk.so\",\n    \"android.hardware.radio.config-V1-ndk.so\",\n    \"android.hardware.radio.config@1.0.so\",\n    \"android.hardware.radio.config@1.1.so\",\n    \"android.hardware.radio.config@1.2.so\",\n    \"android.hardware.radio.data-V1-ndk.so\",\n    \"android.hardware.radio.deprecated@1.0.so\",\n    \"android.hardware.radio.messaging-V1-ndk.so\",\n    \"android.hardware.radio.modem-V1-ndk.so\",\n    \"android.hardware.radio.network-V1-ndk.so\",\n    \"android.hardware.radio.sim-V1-ndk.so\",\n    \"android.hardware.radio.voice-V1-ndk.so\",\n    \"android.hardware.radio@1.0.so\",\n    \"android.hardware.radio@1.1.so\",\n    \"android.hardware.radio@1.2.so\",\n    \"android.hardware.radio@1.3.so\",\n    \"android.hardware.radio@1.4.so\",\n    \"android.hardware.radio@1.5.so\",\n    \"android.hardware.rebootescrow-V1-ndk.so\",\n    \"android.hardware.rebootescrow-V1-ndk_platform.so\",\n    \"android.hardware.renderscript@1.0.so\",\n    \"android.hardware.secure_element@1.0.so\",\n    \"android.hardware.secure_element@1.1.so\",\n    \"android.hardware.secure_element@1.2.so\",\n    \"android.hardware.security.dice-V1-ndk.so\",\n    \"android.hardware.security.keymint-V1-ndk_platform.so\",\n    \"android.hardware.security.keymint-V2-ndk.so\",\n    \"android.hardware.security.secureclock-V1-ndk.so\",\n    \"android.hardware.security.secureclock-V1-ndk_platform.so\",\n    \"android.hardware.security.sharedsecret-V1-ndk.so\",\n    \"android.hardware.security.sharedsecret-V1-ndk_platform.so\",\n    \"android.hardware.sensors-V1-ndk.so\",\n    \"android.hardware.sensors@1.0.so\",\n    \"android.hardware.sensors@2.0.so\",\n    \"android.hardware.sensors@2.1.so\",\n    \"android.hardware.soundtrigger3-V1-ndk.so\",\n    \"android.hardware.soundtrigger@2.0-core.so\",\n    \"android.hardware.soundtrigger@2.0.so\",\n    \"android.hardware.soundtrigger@2.1.so\",\n    \"android.hardware.soundtrigger@2.2.so\",\n    \"android.hardware.soundtrigger@2.3.so\",\n    \"android.hardware.tetheroffload.config@1.0.so\",\n    \"android.hardware.tetheroffload.control@1.0.so\",\n    \"android.hardware.thermal@1.0.so\",\n    \"android.hardware.thermal@1.1.so\",\n    \"android.hardware.thermal@2.0.so\",\n    \"android.hardware.tv.cec@1.0.so\",\n    \"android.hardware.tv.cec@2.0.so\",\n    \"android.hardware.tv.input@1.0.so\",\n    \"android.hardware.tv.tuner@1.0.so\",\n    \"android.hardware.usb-V1-ndk.so\",\n    \"android.hardware.usb.gadget@1.0.so\",\n    \"android.hardware.usb.gadget@1.1.so\",\n    \"android.hardware.usb@1.0.so\",\n    \"android.hardware.usb@1.1.so\",\n    \"android.hardware.usb@1.2.so\",\n    \"android.hardware.uwb-V1-ndk.so\",\n    \"android.hardware.vibrator-V1-ndk_platform.so\",\n    \"android.hardware.vibrator-V2-ndk.so\",\n    \"android.hardware.vibrator-V2-ndk_platform.so\",\n    \"android.hardware.vibrator@1.0.so\",\n    \"android.hardware.vibrator@1.1.so\",\n    \"android.hardware.vibrator@1.2.so\",\n    \"android.hardware.vibrator@1.3.so\",\n    \"android.hardware.vr@1.0.so\",\n    \"android.hardware.weaver-V1-ndk.so\",\n    \"android.hardware.weaver-V1-ndk_platform.so\",\n    \"android.hardware.weaver@1.0.so\",\n    \"android.hardware.wifi.hostapd-V1-ndk.so\",\n    \"android.hardware.wifi.hostapd@1.0.so\",\n    \"android.hardware.wifi.hostapd@1.1.so\",\n    \"android.hardware.wifi.hostapd@1.2.so\",\n    \"android.hardware.wifi.offload@1.0.so\",\n    \"android.hardware.wifi.supplicant-V1-ndk.so\",\n    \"android.hardware.wifi.supplicant@1.0.so\",\n    \"android.hardware.wifi.supplicant@1.1.so\",\n    \"android.hardware.wifi.supplicant@1.2.so\",\n    \"android.hardware.wifi.supplicant@1.3.so\",\n    \"android.hardware.wifi@1.0.so\",\n    \"android.hardware.wifi@1.1.so\",\n    \"android.hardware.wifi@1.2.so\",\n    \"android.hardware.wifi@1.3.so\",\n    \"android.hardware.wifi@1.4.so\",\n    \"android.hidl.allocator@1.0.so\",\n    \"android.hidl.memory.block@1.0.so\",\n    \"android.hidl.memory.token@1.0.so\",\n    \"android.hidl.memory@1.0-impl.so\",\n    \"android.hidl.memory@1.0.so\",\n    \"android.hidl.safe_union@1.0.so\",\n    \"android.hidl.token@1.0-utils.so\",\n    \"android.hidl.token@1.0.so\",\n    \"android.media.audio.common.types-V1-ndk.so\",\n    \"android.media.soundtrigger.types-V1-ndk.so\",\n    \"android.system.keystore2-V1-ndk_platform.so\",\n    \"android.system.keystore2-V2-ndk.so\",\n    \"android.system.net.netd@1.0.so\",\n    \"android.system.net.netd@1.1.so\",\n    \"android.system.suspend-V1-ndk.so\",\n    \"android.system.suspend@1.0.so\",\n    \"android.system.wifi.keystore@1.0.so\",\n    \"audio.a2dp.default.so\",\n    \"hidl.tests.vendor@1.0.so\",\n    \"hidl.tests.vendor@1.1.so\",\n    \"ld-android.so\",\n    \"libEGL.so\",\n    \"libETC1.so\",\n    \"libFFTEm.so\",\n    \"libGLESv1_CM.so\",\n    \"libGLESv2.so\",\n    \"libGLESv3.so\",\n    \"libLLVM_android.so\",\n    \"libOpenMAXAL.so\",\n    \"libOpenSLES.so\",\n    \"libRS.so\",\n    \"libRSCacheDir.so\",\n    \"libRSCpuRef.so\",\n    \"libRSDriver.so\",\n    \"libRS_internal.so\",\n    \"libRScpp.so\",\n    \"libaacextractor.so\",\n    \"libaaudio.so\",\n    \"libaaudioservice.so\",\n    \"libadbconnection.so\",\n    \"libadbconnectiond.so\",\n    \"libadf.so\",\n    \"libamrextractor.so\",\n    \"libandroid.so\",\n    \"libandroid_net.so\",\n    \"libandroid_runtime.so\",\n    \"libandroid_servers.so\",\n    \"libandroidfw.so\",\n    \"libappfuse.so\",\n    \"libart-compiler.so\",\n    \"libart-dexlayout.so\",\n    \"libart-disassembler.so\",\n    \"libart.so\",\n    \"libartd-compiler.so\",\n    \"libartd-dexlayout.so\",\n    \"libartd.so\",\n    \"libasyncio.so\",\n    \"libaudioclient.so\",\n    \"libaudioeffect_jni.so\",\n    \"libaudioflinger.so\",\n    \"libaudiohal.so\",\n    \"libaudiohal@2.0.so\",\n    \"libaudiohal_deathhandler.so\",\n    \"libaudiomanager.so\",\n    \"libaudiopolicyenginedefault.so\",\n    \"libaudiopolicymanager.so\",\n    \"libaudiopolicymanagerdefault.so\",\n    \"libaudiopolicyservice.so\",\n    \"libaudiopreprocessing.so\",\n    \"libaudioprocessing.so\",\n    \"libaudioroute.so\",\n    \"libaudiospdif.so\",\n    \"libaudioutils.so\",\n    \"libavservices_minijail.so\",\n    \"libavservices_minijail_vendor.so\",\n    \"libbacktrace.so\",\n    \"libbase.so\",\n    \"libbcc.so\",\n    \"libbcinfo.so\",\n    \"libbinder.so\",\n    \"libbinder_ndk.so\",\n    \"libbinderthreadstate.so\",\n    \"libbinderwrapper.so\",\n    \"libblas.so\",\n    \"libbluetooth-binder.so\",\n    \"libbluetooth.so\",\n    \"libbluetooth_jni.so\",\n    \"libbootanimation.so\",\n    \"libbrillo-binder.so\",\n    \"libbrillo-stream.so\",\n    \"libbrillo.so\",\n    \"libbrotli.so\",\n    \"libbufferhub.so\",\n    \"libbufferhubqueue.so\",\n    \"libbufferqueueconverter.so\",\n    \"libbundlewrapper.so\",\n    \"libbz.so\",\n    \"libc++.so\",\n    \"libc++_shared.so\",\n    \"libc.so\",\n    \"libc_malloc_debug.so\",\n    \"libcamera2ndk.so\",\n    \"libcamera_client.so\",\n    \"libcamera_metadata.so\",\n    \"libcameraservice.so\",\n    \"libcap.so\",\n    \"libcgrouprc.so\",\n    \"libchrome.so\",\n    \"libclang_rt.asan-aarch64-android.so\",\n    \"libclang_rt.asan-arm-android.so\",\n    \"libclang_rt.asan-i686-android.so\",\n    \"libclang_rt.asan-mips-android.so\",\n    \"libclang_rt.asan-mips64-android.so\",\n    \"libclang_rt.asan-x86_64-android.so\",\n    \"libclang_rt.hwasan-aarch64-android.so\",\n    \"libclang_rt.scudo-aarch64-android.so\",\n    \"libclang_rt.scudo-arm-android.so\",\n    \"libclang_rt.scudo-i686-android.so\",\n    \"libclang_rt.scudo-x86_64-android.so\",\n    \"libclang_rt.scudo_minimal-aarch64-android.so\",\n    \"libclang_rt.scudo_minimal-arm-android.so\",\n    \"libclang_rt.scudo_minimal-i686-android.so\",\n    \"libclang_rt.scudo_minimal-x86_64-android.so\",\n    \"libclang_rt.ubsan_minimal-aarch64-android.so\",\n    \"libclang_rt.ubsan_minimal-arm-android.so\",\n    \"libclang_rt.ubsan_minimal-i686-android.so\",\n    \"libclang_rt.ubsan_minimal-x86_64-android.so\",\n    \"libclang_rt.ubsan_standalone-aarch64-android.so\",\n    \"libclang_rt.ubsan_standalone-arm-android.so\",\n    \"libclang_rt.ubsan_standalone-i686-android.so\",\n    \"libclang_rt.ubsan_standalone-x86_64-android.so\",\n    \"libcld80211.so\",\n    \"libcn-cbor.so\",\n    \"libcodec2.so\",\n    \"libcodec2_hidl@1.0.so\",\n    \"libcodec2_vndk.so\",\n    \"libcom.android.tethering.connectivity_native.so\",\n    \"libcompiler_rt.so\",\n    \"libcrypto.so\",\n    \"libcrypto_utils.so\",\n    \"libcups.so\",\n    \"libcurl.so\",\n    \"libcutils.so\",\n    \"libdebuggerd_client.so\",\n    \"libdefcontainer_jni.so\",\n    \"libdexfile.so\",\n    \"libdiskconfig.so\",\n    \"libdisplayservicehidl.so\",\n    \"libdl.so\",\n    \"libdl_android.so\",\n    \"libdmabufheap.so\",\n    \"libdng_sdk.so\",\n    \"libdownmix.so\",\n    \"libdrm.so\",\n    \"libdrmframework.so\",\n    \"libdrmframework_jni.so\",\n    \"libdt_fd_forward.so\",\n    \"libdt_socket.so\",\n    \"libdumpstateaidl.so\",\n    \"libdumpstateutil.so\",\n    \"libeffectproxy.so\",\n    \"libeffects.so\",\n    \"libeffectsconfig.so\",\n    \"libevent.so\",\n    \"libexif.so\",\n    \"libexpat.so\",\n    \"libext2_blkid.so\",\n    \"libext2_com_err.so\",\n    \"libext2_e2p.so\",\n    \"libext2_misc.so\",\n    \"libext2_quota.so\",\n    \"libext2_uuid.so\",\n    \"libext2fs.so\",\n    \"libext4_utils.so\",\n    \"libf2fs_sparseblock.so\",\n    \"libfilterfw.so\",\n    \"libfilterpack_imageproc.so\",\n    \"libflacextractor.so\",\n    \"libfmq.so\",\n    \"libframesequence.so\",\n    \"libft2.so\",\n    \"libfwdlockengine.so\",\n    \"libgatekeeper.so\",\n    \"libgiftranscode.so\",\n    \"libgralloctypes.so\",\n    \"libgraphicsenv.so\",\n    \"libgtest_prod.so\",\n    \"libgui.so\",\n    \"libgui_vendor.so\",\n    \"libhardware.so\",\n    \"libhardware_legacy.so\",\n    \"libharfbuzz_ng.so\",\n    \"libheif.so\",\n    \"libhidcommand_jni.so\",\n    \"libhidl-gen-hash.so\",\n    \"libhidl-gen-utils.so\",\n    \"libhidlallocatorutils.so\",\n    \"libhidlbase.so\",\n    \"libhidlcache.so\",\n    \"libhidlmemory.so\",\n    \"libhidltransport.so\",\n    \"libhwbinder.so\",\n    \"libhwbinder_noltopgo.so\",\n    \"libhwc2on1adapter.so\",\n    \"libhwui.so\",\n    \"libicui18n.so\",\n    \"libicuuc.so\",\n    \"libimg_utils.so\",\n    \"libincident.so\",\n    \"libinput.so\",\n    \"libinputflinger.so\",\n    \"libinputservice.so\",\n    \"libion.so\",\n    \"libiprouteutil.so\",\n    \"libjavacore.so\",\n    \"libjavacrypto.so\",\n    \"libjdwp.so\",\n    \"libjni_pacprocessor.so\",\n    \"libjnigraphics.so\",\n    \"libjpeg.so\",\n    \"libjsoncpp.so\",\n    \"libkeymaster4support.so\",\n    \"libkeymaster_messages.so\",\n    \"libkeymaster_portable.so\",\n    \"libkeystore-engine.so\",\n    \"libkeystore_aidl.so\",\n    \"libkeystore_binder.so\",\n    \"libkeystore_parcelables.so\",\n    \"libkeyutils.so\",\n    \"liblayers_proto.so\",\n    \"libldacBT_abr.so\",\n    \"libldacBT_enc.so\",\n    \"libldnhncr.so\",\n    \"liblog.so\",\n    \"liblogwrap.so\",\n    \"liblshal.so\",\n    \"liblz4.so\",\n    \"liblzma.so\",\n    \"libm.so\",\n    \"libmdnssd.so\",\n    \"libmedia.so\",\n    \"libmedia_helper.so\",\n    \"libmedia_jni.so\",\n    \"libmedia_omx.so\",\n    \"libmediadrm.so\",\n    \"libmediaextractorservice.so\",\n    \"libmedialogservice.so\",\n    \"libmediametrics.so\",\n    \"libmediandk.so\",\n    \"libmediaplayerservice.so\",\n    \"libmediautils.so\",\n    \"libmemtrack.so\",\n    \"libmemunreachable.so\",\n    \"libmetricslogger.so\",\n    \"libmidiextractor.so\",\n    \"libminijail.so\",\n    \"libminikin.so\",\n    \"libmkbootimg_abi_check.so\",\n    \"libmkvextractor.so\",\n    \"libmp3extractor.so\",\n    \"libmp4extractor.so\",\n    \"libmpeg2extractor.so\",\n    \"libmtp.so\",\n    \"libnativehelper.so\",\n    \"libnativewindow.so\",\n    \"libnbaio.so\",\n    \"libnbaio_mono.so\",\n    \"libnblog.so\",\n    \"libnetd_client.so\",\n    \"libnetdutils.so\",\n    \"libnetlink.so\",\n    \"libnetutils.so\",\n    \"libneuralnetworks.so\",\n    \"libnfc-nci.so\",\n    \"libnfc_nci_jni.so\",\n    \"libnl.so\",\n    \"libnpt.so\",\n    \"liboggextractor.so\",\n    \"libopenjdk.so\",\n    \"libopenjdkd.so\",\n    \"libopenjdkjvm.so\",\n    \"libopenjdkjvmd.so\",\n    \"libopenjdkjvmti.so\",\n    \"libopenjdkjvmtid.so\",\n    \"libopus.so\",\n    \"libpackagelistparser.so\",\n    \"libpagemap.so\",\n    \"libpcap.so\",\n    \"libpcre2.so\",\n    \"libpcrecpp.so\",\n    \"libpdfium.so\",\n    \"libpdx_default_transport.so\",\n    \"libpiex.so\",\n    \"libpixelflinger.so\",\n    \"libpng.so\",\n    \"libpower.so\",\n    \"libpowermanager.so\",\n    \"libprintspooler_jni.so\",\n    \"libprocessgroup.so\",\n    \"libprocinfo.so\",\n    \"libprotobuf-cpp-full.so\",\n    \"libprotobuf-cpp-lite.so\",\n    \"libprotoutil.so\",\n    \"libpuresoftkeymasterdevice.so\",\n    \"libqtaguid.so\",\n    \"libradio_metadata.so\",\n    \"libreference-ril.so\",\n    \"libresourcemanagerservice.so\",\n    \"libreverbwrapper.so\",\n    \"libril.so\",\n    \"librilutils.so\",\n    \"librs_jni.so\",\n    \"librtp_jni.so\",\n    \"libschedulerservicehidl.so\",\n    \"libselinux.so\",\n    \"libsensor.so\",\n    \"libsensorservice.so\",\n    \"libsensorservicehidl.so\",\n    \"libsepol.so\",\n    \"libservices.so\",\n    \"libsigchain.so\",\n    \"libsoftkeymasterdevice.so\",\n    \"libsonic.so\",\n    \"libsonivox.so\",\n    \"libsoundpool.so\",\n    \"libsoundtrigger.so\",\n    \"libsoundtriggerservice.so\",\n    \"libsparse.so\",\n    \"libspeexresampler.so\",\n    \"libsqlite.so\",\n    \"libssl.so\",\n    \"libstagefright.so\",\n    \"libstagefright_amrnb_common.so\",\n    \"libstagefright_bufferpool@2.0.so\",\n    \"libstagefright_bufferqueue_helper.so\",\n    \"libstagefright_enc_common.so\",\n    \"libstagefright_flacdec.so\",\n    \"libstagefright_foundation.so\",\n    \"libstagefright_http_support.so\",\n    \"libstagefright_httplive.so\",\n    \"libstagefright_omx.so\",\n    \"libstagefright_omx_utils.so\",\n    \"libstagefright_soft_aacdec.so\",\n    \"libstagefright_soft_aacenc.so\",\n    \"libstagefright_soft_amrdec.so\",\n    \"libstagefright_soft_amrnbenc.so\",\n    \"libstagefright_soft_amrwbenc.so\",\n    \"libstagefright_soft_avcdec.so\",\n    \"libstagefright_soft_avcenc.so\",\n    \"libstagefright_soft_flacdec.so\",\n    \"libstagefright_soft_flacenc.so\",\n    \"libstagefright_soft_g711dec.so\",\n    \"libstagefright_soft_gsmdec.so\",\n    \"libstagefright_soft_hevcdec.so\",\n    \"libstagefright_soft_mp3dec.so\",\n    \"libstagefright_soft_mpeg2dec.so\",\n    \"libstagefright_soft_mpeg4dec.so\",\n    \"libstagefright_soft_mpeg4enc.so\",\n    \"libstagefright_soft_opusdec.so\",\n    \"libstagefright_soft_rawdec.so\",\n    \"libstagefright_soft_vorbisdec.so\",\n    \"libstagefright_soft_vpxdec.so\",\n    \"libstagefright_soft_vpxenc.so\",\n    \"libstagefright_softomx.so\",\n    \"libstagefright_xmlparser.so\",\n    \"libstatslog.so\",\n    \"libstdc++.so\",\n    \"libsurfaceflinger.so\",\n    \"libsuspend.so\",\n    \"libsync.so\",\n    \"libsysutils.so\",\n    \"libtextclassifier.so\",\n    \"libtextclassifier_hash.so\",\n    \"libtinyalsa.so\",\n    \"libtinycompress.so\",\n    \"libtinyxml2.so\",\n    \"libtombstoned_client.so\",\n    \"libui.so\",\n    \"libunwind.so\",\n    \"libunwindstack.so\",\n    \"libusbhost.so\",\n    \"libutils.so\",\n    \"libutilscallstack.so\",\n    \"libvintf.so\",\n    \"libvisualizer.so\",\n    \"libvixl-arm.so\",\n    \"libvixl-arm64.so\",\n    \"libvndksupport.so\",\n    \"libvorbisidec.so\",\n    \"libvulkan.so\",\n    \"libwavextractor.so\",\n    \"libwebrtc_audio_preprocessing.so\",\n    \"libwebviewchromium_loader.so\",\n    \"libwebviewchromium_plat_support.so\",\n    \"libwfds.so\",\n    \"libwifi-service.so\",\n    \"libwifi-system-iface.so\",\n    \"libwifi-system.so\",\n    \"libwifikeystorehal.so\",\n    \"libwilhelm.so\",\n    \"libxml2.so\",\n    \"libyuv.so\",\n    \"libz.so\",\n    \"libziparchive.so\",\n]\n\nIGNORE_FILENAMES = [\n    # Property files\n    \"build.prop\",\n    \"default.prop\",\n    # config.fs\n    \"fs_config_dirs\",\n    \"fs_config_files\",\n    \"group\",\n    # Licenses\n    \"NOTICE.xml.gz\",\n    \"NOTICE_GPL.html.gz\",\n    \"NOTICE_GPL.xml.gz\",\n    \"passwd\",\n    # Recovery patch\n    \"recovery-from-boot.p\",\n    # Partition symlinks\n    \"odm\",\n    \"product\",\n    \"system\",\n    \"system_ext\",\n    \"vendor\",\n]\n\nIGNORE_EXTENSIONS = [\n    # Apps's odex/vdex\n    \"odex\",\n    \"vdex\",\n]\n\nIGNORE_FOLDERS = [\n    # Hostapd config\n    \"etc/hostapd\",\n    # Device init scripts\n    \"etc/init/hw\",\n    # Permissions\n    \"etc/permissions\",\n    # SELinux\n    \"etc/selinux\",\n    # Kernel modules\n    \"lib/modules\",\n    # ADSP tests\n    \"lib/rfsa/adsp/tests\",\n    # RRO overlays\n    \"overlay\",\n    # RFS symlinks\n    \"rfs\",\n]\n\nIGNORE_PATHS = [\n    # VINTF\n    \"etc/vintf/compatibility_matrix.xml\",\n    \"etc/vintf/manifest.xml\",\n]\n\nIGNORE_PATTERNS = [\n    re.compile(pattern)\n    for pattern in [\n        # Shell scripts\n        \"bin/.*\\\\.sh\",\n        # TODO: Find a cleaner way to exclude AOSP interfaces libs,\n        # We're currently excluding all AOSP interfaces libs except impl\n        \"^(?!lib(64)?/(hw/)?android\\\\..*\\\\..*-impl.so)lib(64)?/(hw/)?android\\\\..*\\\\..*.so\",\n        # Versioned libprotobuf library\n        \"lib(64)?/libprotobuf-cpp-(full|lite)-.*.so\",\n    ]\n]\n\n\ndef is_blob_allowed(file: Path) -> bool:\n    \"\"\"\n    Check if the lib is not in the disallowed list.\n    \"\"\"\n    if file.name in IGNORE_BINARIES:\n        return False\n\n    if file.name in IGNORE_SHARED_LIBS:\n        return False\n\n    if file.name in IGNORE_FILENAMES:\n        return False\n\n    if removeprefix(file.suffix, \".\") in IGNORE_EXTENSIONS:\n        return False\n\n    for folder in [str(folder) for folder in file.parents]:\n        if folder in IGNORE_FOLDERS:\n            return False\n\n    if str(file) in IGNORE_PATHS:\n        return False\n\n    for pattern in IGNORE_PATTERNS:\n        if pattern.match(str(file)):\n            return False\n\n    return True\n"
  },
  {
    "path": "aospdtgen/proprietary_files/proprietary_files_list.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nfrom sebaubuntu_libs.libandroid.partitions.partition import AndroidPartition\nfrom sebaubuntu_libs.libreorder import strcoll_files_key\nfrom typing import Dict, List, Optional\n\nfrom aospdtgen.proprietary_files.ignore import is_blob_allowed\nfrom aospdtgen.proprietary_files.section import Section, sections\n\n\nclass ProprietaryFilesList:\n    \"\"\"Class representing a proprietary files list.\"\"\"\n\n    def __init__(self, partitions: List[AndroidPartition]):\n        \"\"\"Initialize a new ProprietaryFilesList object.\"\"\"\n        self.partitions = partitions\n\n        self.section_to_files: Dict[Section, List[Path]] = {section: [] for section in sections}\n\n        for partition in self.partitions:\n            files: List[Path] = []\n\n            for file in partition.files:\n                file_relative = file.relative_to(partition.path)\n                # Filter out ignored files\n                if is_blob_allowed(file_relative):\n                    files.append(file)\n\n            for section in sections:\n                matched, not_matched = section.add_files(files, partition)\n\n                self.section_to_files[section].extend(\n                    partition.model.proprietary_files_prefix / file.relative_to(partition.path)\n                    for file in matched\n                )\n\n                files = not_matched\n\n    def __str__(self) -> str:\n        return self.get_formatted_list()\n\n    def get_formatted_list(self, build_description: Optional[str] = None) -> str:\n        result = \"\"\n        if build_description:\n            result += f\"# Unpinned blobs from {build_description}\\n\"\n\n        for section, files in self.section_to_files.items():\n            if not files:\n                continue\n\n            result += f\"\\n# {section.name}\\n\"\n            result += \"\\n\".join(str(file) for file in self._sort_files(files))\n            result += \"\\n\"\n\n        return result\n\n    @staticmethod\n    def _sort_files(files: List[Path]) -> List[Path]:\n        return sorted(files, key=strcoll_files_key)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/section.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom importlib import import_module\nfrom pathlib import Path\nfrom pkgutil import iter_modules\nfrom re import match\nfrom sebaubuntu_libs.libandroid.elf.elf import ELF\nfrom sebaubuntu_libs.libandroid.partitions.partition import AndroidPartition\nfrom sebaubuntu_libs.libexception import format_exception\nfrom sebaubuntu_libs.liblogging import LOGE\nfrom sebaubuntu_libs.libpath import is_relative_to\nfrom sebaubuntu_libs.libstring import removesuffix\nfrom typing import Dict, List, Tuple, Type\n\nfrom aospdtgen.proprietary_files.elf import get_shared_libs\n\n\nclass Section:\n    \"\"\"Class representing a proprietary files list section.\"\"\"\n\n    name: str\n    \"\"\"Name of the section\"\"\"\n    interfaces: List[str] = []\n    \"\"\"List of interfaces\"\"\"\n    hardware_modules: List[str] = []\n    \"\"\"List of hardware modules IDs\"\"\"\n    apexes: List[str] = []\n    \"\"\"List of APEXes\"\"\"\n    apps: List[str] = []\n    \"\"\"List of app names\"\"\"\n    binaries: List[str] = []\n    \"\"\"List of binaries/services\"\"\"\n    libraries: List[str] = []\n    \"\"\"List of libraries (omit the .so)\"\"\"\n    filenames: List[str] = []\n    \"\"\"List of exact file names\"\"\"\n    folders: List[str] = []\n    \"\"\"List of folders\"\"\"\n    patterns: List[str] = []\n    \"\"\"List of basic patterns (use regex)\"\"\"\n    properties_prefixes: Dict[str, bool] = {}\n    \"\"\"List of properties prefix to whether it's an exact match\"\"\"\n\n    @classmethod\n    def add_files(\n        cls,\n        files: List[Path],\n        partition: AndroidPartition,\n    ) -> Tuple[List[Path], List[Path]]:\n        \"\"\"\n        Return the list of files matching the section and the list of files not matching the section\n        (after handling shared libs for the matched files).\n        \"\"\"\n        matched: List[Path] = []\n        not_matched: List[Path] = []\n\n        for file in files:\n            file_relative = file.relative_to(partition.path)\n            (matched if cls.file_match(file_relative) else not_matched).append(file)\n\n        # Handle shared libs\n        for file in matched:\n            file_relative = file.relative_to(partition.path)\n            # Check only ELFs\n            if (\n                not is_relative_to(file_relative, \"bin\")\n                and not is_relative_to(file_relative, \"lib\")\n                and not is_relative_to(file_relative, \"lib64\")\n            ):\n                continue\n\n            # Add shared libs used by the section ELFs\n            needed_libs = ELF.get_needed_libs(file)\n            for lib in needed_libs:\n                # Skip the lib if it belongs to another section\n                skip = False\n\n                for interface in known_interfaces:\n                    if match(f\"{interface}(@[0-9]+\\\\.[0-9]+|-).*\\\\.so\", lib):\n                        skip = True\n                        break\n\n                if removesuffix(lib, \".so\") in known_libraries:\n                    skip = True\n\n                if skip:\n                    continue\n\n                # Recursively handle shared libs' shared libs as well\n                unmatched_shared_libs = get_shared_libs(not_matched)\n                for file in unmatched_shared_libs:\n                    if file.name != lib:\n                        continue\n\n                    # Move from unmatched to matched\n                    not_matched.remove(file)\n                    matched.append(file)\n\n        return (matched, not_matched)\n\n    @classmethod\n    def file_match(cls, file: Path):\n        # Interfaces\n        for interface in cls.interfaces:\n            # Service binary (we try)\n            if is_relative_to(file, \"bin\") and interface in file.name:\n                return True\n\n            # Service init script (we try)\n            if is_relative_to(file, \"etc/init\") and interface in file.name:\n                return True\n\n            # VINTF fragment (again, we try)\n            if is_relative_to(file, \"etc/vintf/manifest\") and interface in file.name:\n                return True\n\n            # Passthrough impl (only HIDL)\n            if (is_relative_to(file, \"lib/hw\") or is_relative_to(file, \"lib64/hw\")) and match(\n                f\"{interface}@[0-9]+\\\\.[0-9]+-impl\\\\.so\", file.name\n            ):\n                return True\n\n            # Interface libs (AIDL and HIDL)\n            if (is_relative_to(file, \"lib\") or is_relative_to(file, \"lib64\")) and match(\n                f\"{interface}(@[0-9]+\\\\.[0-9]+|-).*\\\\.so\", file.name\n            ):\n                return True\n\n        # Hardware modules\n        if is_relative_to(file, \"lib/hw\") or is_relative_to(file, \"lib64/hw\"):\n            for hardware_module in cls.hardware_modules:\n                if file.name.startswith(f\"{hardware_module}.\") and file.suffix == \".so\":\n                    return True\n\n        # APEXes\n        if is_relative_to(file, \"apex\") and file.suffix == \".apex\" and file.stem in cls.apexes:\n            return True\n\n        # Apps\n        if is_relative_to(file, \"app\") or is_relative_to(file, \"priv-app\"):\n            if file.suffix == \".apk\" and file.stem in cls.apps:\n                return True\n\n        # Binaries\n        if is_relative_to(file, \"bin\") and file.name in cls.binaries:\n            return True\n\n        # Init scripts\n        if is_relative_to(file, \"etc/init\"):\n            for binary in cls.binaries:\n                if match(f\"(init)?(.)?{binary}\\\\.rc\", file.name):\n                    return True\n\n        # Libraries\n        if is_relative_to(file, \"lib/\") or is_relative_to(file, \"lib64/\"):\n            if file.suffix == \".so\" and file.stem in cls.libraries:\n                return True\n\n        # Filenames\n        if file.name in cls.filenames:\n            return True\n\n        # Folders\n        for folder in [str(folder) for folder in file.parents]:\n            if folder in cls.folders:\n                return True\n\n        # Patterns\n        if [pattern for pattern in cls.patterns if match(pattern, str(file))]:\n            return True\n\n        return False\n\n    @classmethod\n    def property_match(cls, prop: str):\n        \"\"\"Check if the property matches the prefixes.\"\"\"\n        for prefix, exact_match in cls.properties_prefixes.items():\n            if prop == prefix if exact_match else prop.startswith(prefix):\n                return True\n\n        return False\n\n\nsections: List[Section] = []\nknown_interfaces: List[str] = []\nknown_libraries: List[str] = []\n\n\ndef register_section(section: Type[Section]):\n    sections.append(section())\n\n    for interface in section.interfaces:\n        assert interface not in known_interfaces, f\"Duplicate interface: {interface}\"\n        known_interfaces.append(interface)\n\n    for library in section.libraries:\n        assert library not in known_libraries, f\"Duplicate shared library: {library}\"\n        known_libraries.append(library)\n\n\ndef register_sections(sections_path: Path):\n    \"\"\"Import all the sections and let them execute register_section().\"\"\"\n    for section_name in [name for _, name, _ in iter_modules([str(sections_path)])]:\n        try:\n            import_module(f\"aospdtgen.proprietary_files.sections.{section_name}\")\n        except Exception as e:\n            LOGE(f\"Error importing section {section_name}:\\n{format_exception(e)}\")\n\n    # After all sections are registered, now register miscellaneous section\n    from aospdtgen.proprietary_files.sections.miscellaneous import MiscellaneousSection\n\n    register_section(MiscellaneousSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/acdb.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AcdbSection(Section):\n    name = \"ACDB\"\n    folders = [\n        \"etc/acdbdata\",\n    ]\n\n\nregister_section(AcdbSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/adsp.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AdspSection(Section):\n    name = \"ADSP\"\n    interfaces = [\n        \"vendor.qti.adsprpc\",\n    ]\n    binaries = [\n        \"adsprpcd\",\n    ]\n    libraries = [\n        \"libadsprpc\",\n        \"libadsp_default_listener\",\n    ]\n\n\nclass AdspModulesSection(Section):\n    name = \"ADSP modules\"\n    folders = [\n        \"lib/rfs/dsp\",\n        \"lib/rfsa/adsp\",\n        \"lib64/rfs/dsp\",\n        \"lib64/rfsa/adsp\",\n    ]\n\n\nregister_section(AdspSection)\nregister_section(AdspModulesSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/alarm.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AlarmSection(Section):\n    name = \"Alarm\"\n    interfaces = [\n        \"vendor.qti.hardware.alarm\",\n    ]\n    apps = [\n        \"PowerOffAlarm\",\n    ]\n    binaries = [\n        \"power_off_alarm\",\n        \"poweroffm64\",\n    ]\n\n\nregister_section(AlarmSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/ant.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AntSection(Section):\n    name = \"ANT\"\n    interfaces = [\n        \"com.dsi.ant\",\n        \"com.qualcomm.qti.ant\",\n        \"vendor.xiaomi.hardware.antdtx\",\n    ]\n\n\nclass AntFirmwareSection(Section):\n    name = \"ANT firmware\"\n    patterns = [\n        r\"(.*/)?firmware/antdtx\\..*\",\n    ]\n\n\nregister_section(AntSection)\nregister_section(AntFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/atrace.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AtraceSection(Section):\n    name = \"Atrace\"\n    interfaces = [\n        \"android.hardware.atrace\",\n    ]\n\n\nregister_section(AtraceSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/audio.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AudioSection(Section):\n    name = \"Audio\"\n    interfaces = [\n        \"android.hardware.audio\",\n        \"android.hardware.audio.common\",\n        \"android.hardware.audio.effect\",\n        \"vendor.oplus.hardware.binaural_record\",\n        \"vendor.oplus.hardware.virtual_device.audio\",\n        \"vendor.qti.hardware.audiohalext\",\n    ]\n    hardware_modules = [\n        \"audio.binaural_record\",\n        \"audio.primary\",\n        \"audio.r_submix\",\n        \"audio.usb\",\n        \"audio.virtual\",\n    ]\n    properties_prefixes = {\n        \"aaudio.\": False,\n        \"af.fast_track_multiplier\": True,\n        \"audio.\": False,\n        \"persist.audio.\": False,\n        \"persist.vendor.audio.\": False,\n        \"ro.audio.\": False,\n        \"ro.qc.sdk.audio.\": False,\n        \"ro.vendor.audio.\": False,\n        \"tunnel.audio.\": False,\n        \"use.voice.path.for.pcm.voip\": True,\n        \"vendor.audio.\": False,\n        \"vendor.audio_hal.\": False,\n        \"vendor.voice.path.for.pcm.voip\": True,\n    }\n\n\nclass AudioFxModulesSection(Section):\n    name = \"Audio (FX modules)\"\n    folders = [\n        \"lib/soundfx\",\n        \"lib64/soundfx\",\n    ]\n\n\nclass AudioConfigsSection(Section):\n    name = \"Audio configs\"\n    filenames = [\n        \"audio_io_policy.conf\",\n        \"audio_tuning_mixer.txt\",\n        \"default_volume_tables.xml\",\n    ]\n    folders = [\n        \"etc/audio\",\n    ]\n    patterns = [\n        r\"etc/audio_configs.*\\.xml\",\n        r\"etc/audio_effects.*\\.(conf|xml)\",\n        r\"etc/audio_platform_info.*\\.xml\",\n        r\"etc/.*audio_policy.*\\.xml\",\n        r\"etc/mixer_paths.*\\.xml\",\n        r\"etc/sound_trigger_.*\\.xml\",\n    ]\n\n\nclass AudioCalibrationSection(Section):\n    name = \"Audio calibration\"\n    folders = [\n        \"etc/audio_param\",\n        \"etc/lvacfs_params\",\n        \"etc/smartpa_param\",\n        \"etc/spatializer\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/tfa98xx\\..*\",\n    ]\n\n\nregister_section(AudioSection)\nregister_section(AudioFxModulesSection)\nregister_section(AudioConfigsSection)\nregister_section(AudioCalibrationSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/authsecret.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AuthsecretSection(Section):\n    name = \"Authsecret\"\n    interfaces = [\n        \"android.hardware.authsecret\",\n    ]\n\n\nregister_section(AuthsecretSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/automotive.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass AutomotiveSection(Section):\n    name = \"Automotive\"\n    interfaces = [\n        \"android.hardware.automotive.audiocontrol\",\n        \"android.hardware.automotive.can\",\n        \"android.hardware.automotive.evs\",\n        \"android.hardware.automotive.occupant_awareness\",\n        \"android.hardware.automotive.sv\",\n        \"android.hardware.automotive.vehicle\",\n        \"vendor.qti.hardware.automotive.vehicle\",\n    ]\n\n\nregister_section(AutomotiveSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/bluetooth.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass BluetoothSection(Section):\n    name = \"Bluetooth\"\n    interfaces = [\n        \"android.hardware.bluetooth\",\n    ]\n    hardware_modules = [\n        \"bluetooth\",\n    ]\n    libraries = [\n        \"libbt-vendor\",\n    ]\n    properties_prefixes = {\n        \"bluetooth.\": False,\n        \"persist.bluetooth.\": False,\n        \"persist.sys.btsatck.\": False,  # Xiaomi...\n        \"persist.vendor.bt.\": False,\n        \"persist.vendor.btsatck.\": False,  # Xiaomi...\n        \"persist.vendor.btstack.\": False,\n        \"persist.vendor.qcom.bluetooth.\": False,\n        \"ro.bluetooth.\": False,\n        \"ro.vendor.bluetooth.\": False,\n        \"vendor.bluetooth.\": False,\n        \"vendor.qcom.bluetooth.\": False,\n    }\n\n\nclass BluetoothA2dpSection(Section):\n    name = \"Bluetooth (A2DP)\"\n    interfaces = [\n        \"android.hardware.bluetooth.a2dp\",\n        \"android.hardware.bluetooth.audio\",\n        \"com.qualcomm.qti.bluetooth_audio\",\n        \"vendor.mediatek.hardware.bluetooth.audio\",\n        \"vendor.qti.hardware.bluetooth.audio\",\n        \"vendor.qti.hardware.bluetooth_audio\",\n        \"vendor.qti.hardware.bluetooth_sar\",\n        \"vendor.qti.hardware.btconfigstore\",\n    ]\n    hardware_modules = [\n        \"audio.bluetooth\",\n        \"audio.bluetooth_qti\",\n    ]\n\n\nregister_section(BluetoothSection)\nregister_section(BluetoothA2dpSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/boot.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass BootSection(Section):\n    name = \"Boot\"\n    interfaces = [\n        \"android.hardware.boot\",\n    ]\n\n\nregister_section(BootSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/broadcastradio.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass BroadcastRadioSection(Section):\n    name = \"Broadcast radio\"\n    interfaces = [\n        \"android.hardware.broadcastradio\",\n    ]\n\n\nregister_section(BroadcastRadioSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/camera.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CameraSection(Section):\n    name = \"Camera\"\n    interfaces = [\n        \"android.hardware.camera.common\",\n        \"android.hardware.camera.device\",\n        \"android.hardware.camera.metadata\",\n        \"android.hardware.camera.provider\",\n        \"camera.device\",\n        \"motorola.hardware.camera.imgtuner\",\n        \"vendor.mediatek.hardware.camera.atms\",\n        \"vendor.mediatek.hardware.camera.bgservice\",\n        \"vendor.mediatek.hardware.camera.frhandler\",\n        \"vendor.mediatek.hardware.camera.isphal\",\n        \"vendor.mediatek.hardware.camera.lomoeffect\",\n        \"vendor.mediatek.hardware.camera.postproc\",\n        \"vendor.mediatek.hardware.camera.security\",\n        \"vendor.oplus.hardware.camera_rfi\",\n        \"vendor.oplus.hardware.cammidasservice\",\n        \"vendor.oplus.hardware.extcamera\",\n        \"vendor.oplus.hardware.virtual_device.camera.hal\",\n        \"vendor.oplus.hardware.virtual_device.camera.manager\",\n        \"vendor.oplus.hardware.virtual_device.camera.provider\",\n        \"vendor.qti.camera.provider\",\n        \"vendor.qti.hardware.camera.device\",\n        \"vendor.qti.hardware.camera.offlinecamera\",\n        \"vendor.qti.hardware.camera.postproc\",\n        \"vendor.qti.hardware.scve.objecttracker\",\n        \"vendor.qti.hardware.scve.panorama\",\n        \"vendor.qti.hardware.seccam\",\n    ]\n    hardware_modules = [\n        \"camera\",\n        \"com.qti.chi\",\n    ]\n    binaries = [\n        \"camerahalserver\",\n        \"mm-qcamera-daemon\",\n        \"virtualcameraprovider\",\n    ]\n    libraries = [\n        \"libscveBlobDescriptor_stub\",\n        \"libscveCommon\",\n        \"libscveCommon_stub\",\n        \"libscveObjectSegmentation\",\n        \"libscveObjectSegmentation_stub\",\n        \"libscveObjectTracker\",\n        \"libscveObjectTracker_stub\",\n        \"libscvePanorama\",\n        \"libscvePanorama_lite\",\n        \"libscvePanorama_stub\",\n    ]\n    folders = [\n        \"lib/camera\",\n        \"lib64/camera\",\n    ]\n    patterns = [\n        r\"lib(64)?/com.qti.feature2\\..*\\.so\",\n        r\"lib(64)?/libCamera_.*\\.so\",\n        r\"lib(64)?/libactuator_.*\\.so\",\n        r\"lib(64)?/libarcsoft_.*\\.so\",\n        r\"lib(64)?/libcamx.*\\.so\",\n        r\"lib(64)?/libchromatix_.*\\.so\",\n        r\"lib(64)?/libmmcamera_.*\\.so\",\n        r\"lib(64)?/libmmcamera2_.*\\.so\",\n        r\"lib(64)?/libmtkcam_.*\\.so\",\n        r\"lib(64)?/libois_.*\\.so\",\n    ]\n    properties_prefixes = {\n        \"camera.\": False,\n        \"persist.vendor.camera.\": False,\n        \"vendor.camera.\": False,\n    }\n\n\nclass CameraConfigsSection(Section):\n    name = \"Camera configs\"\n    folders = [\n        \"camera\",\n        \"etc/camera\",\n    ]\n\n\nclass CameraFirmwareSection(Section):\n    name = \"Camera firmware\"\n    patterns = [\n        r\"(.*/)?firmware/CAMERA_ICP.*\",\n        r\"bin/lib3a.*\",\n        r\"bin/libccu_.*\",\n        r\"firmware/lib3a.*\",\n        r\"firmware/libccu_.*\",\n    ]\n\n\nclass CameraMotorSection(Section):\n    name = \"Camera motor\"\n    interfaces = [\n        \"vendor.xiaomi.hardware.motor\",\n    ]\n    libraries = [\n        \"mi.motor.daemon\",\n    ]\n    folders = [\n        \"etc/step_motor\",\n    ]\n    patterns = [\n        r\"lib(64)?/libmivendor_module_.*\\.so\",\n    ]\n\n\nregister_section(CameraSection)\nregister_section(CameraConfigsSection)\nregister_section(CameraFirmwareSection)\nregister_section(CameraMotorSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/cas.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CasSection(Section):\n    name = \"CAS\"\n    interfaces = [\n        \"android.hardware.cas\",\n        \"android.hardware.cas.native\",\n    ]\n\n\nregister_section(CasSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/cdsp.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CdspSection(Section):\n    name = \"CDSP\"\n    interfaces = [\n        \"vendor.qti.cdsprpc\",\n    ]\n    binaries = [\n        \"cdsprpcd\",\n    ]\n    libraries = [\n        \"libcdsprpc\",\n        \"libcdsp_default_listener\",\n        \"libfastcvdsp_stub\",\n        \"libfastcvopt\",\n    ]\n\n\nregister_section(CdspSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/cit.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CitSection(Section):\n    name = \"CIT\"\n    interfaces = [\n        \"vendor.xiaomi.cit.bluetooth\",\n        \"vendor.xiaomi.cit.wifi\",\n        \"vendor.xiaomi.hardware.citsensorservice\",\n        \"vendor.xiaomi.hardware.citvendorservice\",\n    ]\n\n\nregister_section(CitSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/cne.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CneSection(Section):\n    name = \"CNE\"\n    interfaces = [\n        \"com.quicinc.cne.api\",\n        \"com.quicinc.cne.constants\",\n        \"com.quicinc.cne.server\",\n        \"vendor.qti.data.factory\",\n        \"vendor.qti.data.mwqem\",\n        \"vendor.qti.data.slm\",\n        \"vendor.qti.hardware.cacert\",\n        \"vendor.qti.hardware.data.cne.internal.api\",\n        \"vendor.qti.hardware.data.cne.internal.constants\",\n        \"vendor.qti.hardware.data.cne.internal.server\",\n        \"vendor.qti.hardware.data.connection\",\n        \"vendor.qti.hardware.data.connectionaidl\",\n        \"vendor.qti.hardware.data.connectionfactory\",\n        \"vendor.qti.hardware.data.dataactivity\",\n        \"vendor.qti.hardware.data.dynamicdds\",\n        \"vendor.qti.hardware.data.flow\",\n        \"vendor.qti.hardware.data.iwlan\",\n        \"vendor.qti.hardware.data.iwlandata\",\n        \"vendor.qti.hardware.data.ka\",\n        \"vendor.qti.hardware.data.latency\",\n        \"vendor.qti.hardware.data.lce\",\n        \"vendor.qti.hardware.data.qmi\",\n        \"vendor.qti.hardware.factory\",\n        \"vendor.qti.hardware.mwqemadapter\",\n        \"vendor.qti.hardware.slmadapter\",\n        \"vendor.qti.latency\",\n    ]\n    apps = [\n        \"CneApp\",\n    ]\n    binaries = [\n        \"cnd\",\n    ]\n    folders = [\n        \"etc/cne\",\n    ]\n    properties_prefixes = {\n        \"persist.vendor.cne.\": False,\n    }\n\n\nregister_section(CneSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/configstore.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass ConfigstoreSection(Section):\n    name = \"Configstore\"\n    interfaces = [\n        \"android.hardware.configstore\",\n        \"vendor.qti.hardware.capabilityconfigstore\",\n    ]\n    folders = [\n        \"etc/configstore\",\n    ]\n\n\nregister_section(ConfigstoreSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/confirmationui.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass ConfirmationUISection(Section):\n    name = \"Confirmation UI\"\n    interfaces = [\n        \"android.hardware.confirmationui\",\n    ]\n\n\nregister_section(ConfirmationUISection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/contexthub.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass ContextHubSection(Section):\n    name = \"Context hub\"\n    interfaces = [\n        \"android.hardware.contexthub\",\n    ]\n\n\nregister_section(ContextHubSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/cvp.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass CvpSection(Section):\n    name = \"CVP\"\n    interfaces = [\n        \"vendor.qti.hardware.cvp\",\n    ]\n\n\nclass CvpFirmwareSection(Section):\n    name = \"CVP firmware\"\n    patterns = [\n        r\"(.*/)?firmware/evass\\..*\",\n        r\"(.*/)?firmware/evass-lt\\..*\",\n    ]\n\n\nregister_section(CvpSection)\nregister_section(CvpFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/display.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass DisplaySection(Section):\n    name = \"Display\"\n    interfaces = [\n        \"android.hardware.graphics.allocator\",\n        \"android.hardware.graphics.bufferqueue\",\n        \"android.hardware.graphics.common\",\n        \"android.hardware.graphics.composer\",\n        \"android.hardware.graphics.composer3\",\n        \"android.hardware.graphics.mapper\",\n        \"android.hardware.memtrack\",\n        \"com.motorola.hardware.display.panel\",\n        \"com.motorola.hardware.display.touch\",\n        \"vendor.display.color\",\n        \"vendor.display.config\",\n        \"vendor.display.postproc\",\n        \"vendor.mediatek.hardware.composer_ext\",\n        \"vendor.mediatek.hardware.mms\",\n        \"vendor.mediatek.hardware.pq\",\n        \"vendor.oplus.hardware.displaycolorfeature\",\n        \"vendor.oplus.hardware.displaypanelfeature\",\n        \"vendor.qti.hardware.display.allocator\",\n        \"vendor.qti.hardware.display.color\",\n        \"vendor.qti.hardware.display.composer\",\n        \"vendor.qti.hardware.display.config\",\n        \"vendor.qti.hardware.display.mapper\",\n        \"vendor.qti.hardware.display.mapperextensions\",\n        \"vendor.qti.hardware.display.postproc\",\n        \"vendor.qti.hardware.qdutils_disp\",\n        \"vendor.xiaomi.hardware.displayfeature\",\n    ]\n    hardware_modules = [\n        \"copybit\",\n        \"displayfeature\",\n        \"displaypanel\",\n        \"gralloc\",\n        \"hwcomposer\",\n        \"memtrack\",\n        \"vulkan\",\n    ]\n    libraries = [\n        \"libsdedrm\",\n        \"libsdm-color\",\n        \"libsdm-diag\",\n        \"libsdmextension\",\n    ]\n    folders = [\n        \"lib/egl\",\n        \"lib64/egl\",\n    ]\n    properties_prefixes = {\n        \"debug.egl.\": False,\n        \"debug.sf.\": False,\n        \"persist.displayfeature.\": False,\n        \"persist.sys.sf.\": False,\n        \"persist.vendor.dc_backlight.\": False,\n        \"persist.vendor.dfps.\": False,\n        \"ro.gfx.driver.\": False,\n        \"ro.hardware.egl\": True,\n        \"ro.hardware.vulkan\": True,\n        \"ro.hwui.\": False,\n        \"ro.opengles.\": False,\n        \"ro.surface_flinger.\": False,\n        \"ro.vendor.cabc.\": False,\n        \"ro.vendor.colorpick_adjust\": True,\n        \"ro.vendor.dfps.\": False,\n        \"ro.vendor.display.\": False,\n        \"ro.vendor.fps.\": False,\n        \"ro.vendor.hbm_backlight.\": False,\n        \"ro.vendor.histogram.\": False,\n        \"ro.vendor.mi_sf.\": False,\n        \"ro.vendor.whitepoint_calibration_enable\": True,\n        \"vendor.display.\": False,\n        \"vendor.gralloc.\": False,\n    }\n\n\nclass DisplayPixelworksSection(Section):\n    name = \"Display (Pixelworks)\"\n    interfaces = [\n        \"vendor.pixelworks.hardware.display\",\n        \"vendor.pixelworks.hardware.display.iris\",\n        \"vendor.pixelworks.hardware.feature\",\n        \"vendor.pixelworks.hardware.feature.irisfeature\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/pxlw_.*\\..*\",\n    ]\n\n\nclass DisplayConfigsSection(Section):\n    name = \"Display configs\"\n    folders = [\n        \"etc/display\",\n        \"etc/inparm\",\n    ]\n    patterns = [\n        r\"etc/ltm_*\",\n        r\"etc/mdss_*\",\n        r\"etc/qdcm_*\",\n    ]\n\n\nclass DisplayFirmwareSection(Section):\n    name = \"Display firmware\"\n    folders = [\n        \"gpu/kbc\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/a[0-9]+_.*\\..*\",\n        r\"(.*/)?firmware/iris.*\\..*\",\n    ]\n\n\nregister_section(DisplaySection)\nregister_section(DisplayPixelworksSection)\nregister_section(DisplayConfigsSection)\nregister_section(DisplayFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/dpm.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass DpmSection(Section):\n    name = \"DPM\"\n    interfaces = [\n        \"com.qualcomm.qti.dpm.api\",\n        \"vendor.qti.diaghal\",\n        \"vendor.qti.hardware.dpmaidlservice\",\n        \"vendor.qti.hardware.dpmservice\",\n    ]\n    binaries = [\n        \"dpmQmiMgr\",\n        \"dpmd\",\n    ]\n    folders = [\n        \"etc/dpm\",\n    ]\n    properties_prefixes = {\n        \"persist.vendor.dpm.\": False,\n        \"persist.vendor.dpmhalservice.\": False,\n    }\n\n\nregister_section(DpmSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/drm.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass DrmSection(Section):\n    name = \"DRM\"\n    interfaces = [\n        \"android.hardware.drm\",\n    ]\n    apexes = [\n        \"com.google.android.widevine.nonupdatable\",\n    ]\n    libraries = [\n        \"liboemcrypto\",\n    ]\n    folders = [\n        \"lib/mediacas\",\n        \"lib/mediadrm\",\n        \"lib64/mediacas\",\n        \"lib64/mediadrm\",\n    ]\n    properties_prefixes = {\n        \"drm.service.enabled\": True,\n        \"ro.netflix.bsp_rev\": True,\n    }\n\n\nclass DrmQseeSection(Section):\n    name = \"DRM (Qualcomm Secure Execution Environment)\"\n    interfaces = [\n        \"vendor.qti.hardware.qseecom\",\n    ]\n    binaries = [\n        \"qseecomd\",\n    ]\n    libraries = [\n        \"libQSEEComAPI\",\n    ]\n\n\nclass DrmQteeSection(Section):\n    name = \"DRM (Qualcomm Trusted Execution Environment)\"\n    interfaces = [\n        \"vendor.qti.hardware.qteeconnector\",\n    ]\n    libraries = [\n        \"libGPQTEEC_vendor\",\n        \"libGPTEE_vendor\",\n        \"libQTEEConnector_vendor\",\n    ]\n\n\nclass DrmFirmwareSection(Section):\n    name = \"DRM firmware\"\n    folders = [\n        \"etc/firmware/drm\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/widevine\\..*\",\n    ]\n\n\nregister_section(DrmSection)\nregister_section(DrmQseeSection)\nregister_section(DrmQteeSection)\nregister_section(DrmFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/dsp.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass DspSection(Section):\n    name = \"DSP\"\n    interfaces = [\n        \"vendor.qti.hardware.dsp\",\n    ]\n    binaries = [\n        \"dspservice\",\n    ]\n    filenames = [\n        \"vendor.qti.hardware.dsp.policy\",\n    ]\n\n\nregister_section(DspSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/dumpstate.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass DumpstateSection(Section):\n    name = \"Dumpstate\"\n    interfaces = [\n        \"android.hardware.dumpstate\",\n    ]\n\n\nregister_section(DumpstateSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/face.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass FaceSection(Section):\n    name = \"Face\"\n    interfaces = [\n        \"android.hardware.biometrics.face\",\n        \"vendor.oplus.hardware.biometrics.face\",\n    ]\n\n\nregister_section(FaceSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/fastboot.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass FastbootSection(Section):\n    name = \"Fastboot\"\n    interfaces = [\n        \"android.hardware.fastboot\",\n    ]\n\n\nregister_section(FastbootSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/fingerprint.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass FingerprintSection(Section):\n    name = \"Fingerprint\"\n    interfaces = [\n        \"android.hardware.biometrics.fingerprint\",\n        \"vendor.goodix.hardware.biometrics.fingerprint\",\n        \"vendor.oplus.hardware.biometrics.fingerprint\",\n        \"vendor.qti.hardware.fingerprint\",\n        \"vendor.xiaomi.hardware.fingerprintextension\",\n    ]\n    hardware_modules = [\n        \"fingerprint\",\n        \"gf_fingerprint\",\n    ]\n    binaries = [\n        \"qfp-daemon\",\n    ]\n    properties_prefixes = {\n        \"persist.vendor.qfp\": True,\n    }\n\n\nregister_section(FingerprintSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/fm.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass FmSection(Section):\n    name = \"FM\"\n    interfaces = [\n        \"vendor.qti.hardware.fm\",\n    ]\n\n\nregister_section(FmSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/gatekeeper.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass GatekeeperSection(Section):\n    name = \"Gatekeeper\"\n    interfaces = [\n        \"android.hardware.gatekeeper\",\n        \"vendor.microtrust.hardware.thh\",\n        \"vendor.qti.hardware.secureprocessor\",\n        \"vendor.qti.spu\",\n        \"vendor.trustonic.tee\",\n    ]\n    binaries = [\n        \"teei_daemon\",\n    ]\n    hardware_modules = [\n        \"gatekeeper\",\n        \"libSoftGatekeeper\",\n    ]\n    patterns = [\n        r\"etc/init/microtrust.*\\.rc\",\n    ]\n    properties_prefixes = {\n        \"vendor.gatekeeper.\": False,\n    }\n\n\nclass GatekeeperConfigsSection(Section):\n    name = \"Gatekeeper configs\"\n    folders = [\n        \"thh\",\n    ]\n\n\nregister_section(GatekeeperSection)\nregister_section(GatekeeperConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/gnss.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass GnssSection(Section):\n    name = \"GNSS\"\n    interfaces = [\n        \"android.hardware.gnss\",\n        \"android.hardware.gnss.measurement_corrections\",\n        \"android.hardware.gnss.visibility_control\",\n        \"vendor.qti.gnss\",\n    ]\n    hardware_modules = [\n        \"gps\",\n    ]\n    binaries = [\n        \"loc_launcher\",\n        \"lowi-server\",\n        \"mnld\",\n        \"mtk_agpsd\",\n        \"slim_daemon\",\n        \"xtra-daemon\",\n        \"xtwifi-client\",\n        \"xtwifi-inet-agent\",\n    ]\n    patterns = [\n        r\"etc/init/mtk_agps.*\\.rc\",\n    ]\n    properties_prefixes = {\n        \"persist.sys.gps.\": False,\n        \"persist.vendor.overlay.izat.\": False,\n    }\n\n\nclass GnssConfigsSection(Section):\n    name = \"GNSS configs\"\n    filenames = [\n        \"apdr.conf\",\n        \"flp.conf\",\n        \"gps.conf\",\n        \"izat.conf\",\n        \"lowi.conf\",\n        \"sap.conf\",\n        \"xtwifi.conf\",\n    ]\n    folders = [\n        \"etc/gnss\",\n    ]\n\n\nregister_section(GnssSection)\nregister_section(GnssConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/health.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass HealthSection(Section):\n    name = \"Health\"\n    interfaces = [\n        \"android.hardware.health\",\n        \"android.hardware.health.storage\",\n        \"motorola.hardware.health\",\n        \"motorola.hardware.health.storage\",\n        \"motorola.hardware.wireless.wlc\",\n        \"vendor.oplus.hardware.charger\",\n        \"vendor-oplus-hardware-charger\",\n        \"vendor.qti.hardware.charger_monitor\",\n        \"vendor.xiaomi.hardware.micharge\",\n    ]\n    binaries = [\n        \"batterysecret\",\n        \"fuelgauged\",\n        \"hvdcp_opti\",\n        \"init.qti.chg_policy.sh\",\n        \"wlschgd\",\n    ]\n    filenames = [\n        \"charger_fstab.qti\",\n        \"fuelgauged_init.rc\",\n    ]\n    properties_prefixes = {\n        \"ro.charger.\": False,\n    }\n\n\nclass HealthFirmwareSection(Section):\n    name = \"Health firmware\"\n    folders = [\n        \"firmware/fastchg\",\n    ]\n\n\nregister_section(HealthSection)\nregister_section(HealthFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/identity.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass IdentitySection(Section):\n    name = \"Identity\"\n    interfaces = [\n        \"android.hardware.identity\",\n    ]\n\n\nregister_section(IdentitySection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/input.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass InputSection(Section):\n    name = \"Input\"\n    interfaces = [\n        \"android.hardware.input.classifier\",\n        \"android.hardware.input.common\",\n        \"android.hardware.input.processor\",\n    ]\n\n\nclass InputMotorolaSection(Section):\n    name = \"Input (Motorola)\"\n    interfaces = [\n        \"motorola.hardware.input\",\n    ]\n\n\nregister_section(InputSection)\nregister_section(InputMotorolaSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/ipa.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass IpaSection(Section):\n    name = \"IPA\"\n    binaries = [\n        \"ipacm\",\n        \"ipacm-diag\",\n    ]\n    libraries = [\n        \"libipanat\",\n        \"liboffloadhal\",\n    ]\n    filenames = [\n        \"IPACM_cfg.xml\",\n    ]\n\n\nclass IpaFirmwareSection(Section):\n    name = \"IPA firmware\"\n    filenames = [\n        \"ipa_fws.rc\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/.*ipa_(fws|uc)*.\",\n    ]\n\n\nregister_section(IpaSection)\nregister_section(IpaFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/ir.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass IrSection(Section):\n    name = \"IR\"\n    interfaces = [\n        \"android.hardware.ir\",\n    ]\n    hardware_modules = [\n        \"consumerir\",\n    ]\n\n\nregister_section(IrSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/keymaster.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass KeymasterSection(Section):\n    name = \"Keymaster\"\n    interfaces = [\n        \"android.hardware.keymaster\",\n        \"vendor.mediatek.hardware.keymaster_attestation\",\n    ]\n    binaries = [\n        \"bp_kmsetkey_ca\",\n    ]\n    hardware_modules = [\n        \"keystore\",\n        \"kmsetkey\",\n    ]\n\n\nregister_section(KeymasterSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/light.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass LightSection(Section):\n    name = \"Light\"\n    interfaces = [\n        \"android.hardware.light\",\n    ]\n    hardware_modules = [\n        \"lights\",\n    ]\n\n\nregister_section(LightSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/local_time.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass LocalTimeSection(Section):\n    name = \"Local time\"\n    hardware_modules = [\n        \"local_time\",\n    ]\n\n\nregister_section(LocalTimeSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/media.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass MediaSection(Section):\n    name = \"Media\"\n    interfaces = [\n        \"android.hardware.media\",\n        \"android.hardware.media.bufferpool\",\n        \"android.hardware.media.c2\",\n        \"android.hardware.media.omx\",\n        \"vendor.qti.hardware.qconfig\",\n        \"vendor.qti.hardware.vpp\",\n        \"vendor.qti.media.c2\",\n    ]\n    binaries = [\n        \"qconfigservice\",\n        \"vppservice\",\n        \"vpud\",\n    ]\n    filenames = [\n        \"c2_manifest_vendor.xml\",\n        \"mediacodec.policy\",\n    ]\n    patterns = [\n        r\"etc/seccomp_policy/codec2.vendor.*.-arm\\.policy\",\n        r\"lib(64)?/libMtkOmx.*\\.so\",\n        r\"lib(64)?/libOmx.*\\.so\",\n        r\"lib(64)?/libstagefright.*\\.so\",\n    ]\n    properties_prefixes = {\n        \"debug.stagefright.\": False,\n        \"media.\": False,\n    }\n\n\nclass MediaDolbySection(Section):\n    name = \"Media (Dolby)\"\n    interfaces = [\n        \"vendor.dolby.dms\",\n        \"vendor.dolby.hardware.dms\",\n        \"vendor.dolby.media.c2\",\n        \"vendor.dolby_sp.hardware.dmssp\",\n        \"vendor.dolby_sp.media.c2\",\n    ]\n    libraries = [\n        \"libdapparamstorage\",\n        \"libdeccfg\",\n    ]\n    filenames = [\n        \"dolby_vision.cfg\",\n    ]\n    folders = [\n        \"etc/dolby\",\n    ]\n    patterns = [\n        r\"lib(64)?/libdolby.*\\.so\",\n    ]\n    properties_prefixes = {\n        \"ro.vendor.dolby.\": False,\n    }\n\n\nclass MediaOZOAudioSection(Section):\n    name = \"Media (OZO Audio)\"\n    interfaces = [\n        \"vendor.ozoaudio.media.c2\",\n    ]\n\n\nclass MediaConfigsSection(Section):\n    name = \"Media configs\"\n    patterns = [\n        r\"etc/media_codecs.*\\.xml\",\n        r\"etc/media_profiles.*\\.xml\",\n    ]\n\n\nregister_section(MediaSection)\nregister_section(MediaDolbySection)\nregister_section(MediaOZOAudioSection)\nregister_section(MediaConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/miscellaneous.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nfrom sebaubuntu_libs.libandroid.partitions.partition import AndroidPartition\nfrom sebaubuntu_libs.libandroid.partitions.partition_model import PartitionGroup\nfrom typing import List, Tuple\n\nfrom aospdtgen.proprietary_files.section import Section\n\n\nclass MiscellaneousSection(Section):\n    \"\"\"This section must not be registered.\"\"\"\n\n    name = \"Miscellaneous\"\n\n    @classmethod\n    def add_files(\n        cls,\n        files: List[Path],\n        partition: AndroidPartition,\n    ) -> Tuple[List[Path], List[Path]]:\n        if partition.model.group != PartitionGroup.TREBLE:\n            return ([], files)\n\n        return (files, [])\n\n    @classmethod\n    def file_match(cls, file: Path) -> bool:\n        raise NotImplementedError(\"MiscellaneousSection should not be used for matching files\")\n\n    @classmethod\n    def property_match(cls, prop: str):\n        return True\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/neuralnetworks.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass NeuralNetworksSection(Section):\n    name = \"Neural networks\"\n    interfaces = [\n        \"android.hardware.neuralnetworks\",\n        \"vendor.mediatek.hardware.mmagent\",\n    ]\n    binaries = [\n        \"nn_device_test\",\n        \"npu_launcher\",\n    ]\n    libraries = [\n        \"libhexagon_nn_stub\",\n    ]\n    patterns = [\n        r\"lib(64)?/libhta(_.*.)?\\.so\",\n        r\"lib(64)?/unnhal.*.\\.so\",\n    ]\n\n\nregister_section(NeuralNetworksSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/nfc.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass NfcSection(Section):\n    name = \"NFC\"\n    interfaces = [\n        \"android.hardware.nfc\",\n        \"vendor.nxp.hardware.nfc\",\n        \"vendor.oplus.hardware.nfcExtns\",\n        \"vendor.oplus.hardware.nfc_aidl\",\n    ]\n    hardware_modules = [\n        \"nfc\",\n    ]\n    properties_prefixes = {\n        \"ro.nfc.\": False,\n    }\n\n\nclass NfcConfigsSection(Section):\n    name = \"NFC configs\"\n    folders = [\n        \"etc/nfc\",\n    ]\n    patterns = [\n        r\"etc/libnfc-.*\\.conf\",\n        r\"etc/sn100u_.*\\.pnscr\",\n    ]\n\n\nregister_section(NfcSection)\nregister_section(NfcConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/nvram.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass NVRAMSection(Section):\n    name = \"NVRAM\"\n    interfaces = [\n        \"vendor.mediatek.hardware.nvram\",\n    ]\n    binaries = [\n        \"fuelgauged_nvram\",\n        \"nvram_daemon\",\n    ]\n    filenames = [\n        \"fuelgauged_nvram_init.rc\",\n    ]\n\n\nregister_section(NVRAMSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/oemlock.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass OemLockSection(Section):\n    name = \"OEM lock\"\n    interfaces = [\n        \"android.hardware.oemlock\",\n    ]\n\n\nregister_section(OemLockSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/pasr.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass PasrSection(Section):\n    name = \"PASR\"\n    interfaces = [\n        \"vendor.qti.memory.pasrmanager\",\n        \"vendor.qti.power.pasrmanager\",\n    ]\n    apps = [\n        \"pasrservice\",\n    ]\n\n\nregister_section(PasrSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/payment.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass PaymentEIDSection(Section):\n    name = \"Payment (eID)\"\n    interfaces = [\n        \"vendor.qti.hardware.eid\",\n    ]\n\n\nclass PaymentIFAASection(Section):\n    name = \"Payment (IFAA)\"\n    interfaces = [\n        \"vendor.qti.hardware.ifaa\",\n    ]\n    apps = [\n        \"IFAAService\",\n    ]\n\n\nclass PaymentOplusSection(Section):\n    name = \"Payment (oplus)\"\n    interfaces = [\n        \"vendor.oplus.hardware.biometrics.fingerprintpay\",\n        \"vendor.oplus.hardware.fido.fido2ca\",\n        \"vendor.oplus.hardware.fido.fidoca\",\n    ]\n\n\nclass PaymentXiaomiSection(Section):\n    name = \"Payment (Xiaomi)\"\n    interfaces = [\n        \"vendor.fido.fidoca\",\n        \"vendor.xiaomi.hardware.mfidoca\",\n        \"vendor.xiaomi.hardware.mlipay\",\n        \"vendor.xiaomi.hardware.mtdservice\",\n        \"vendor.xiaomi.hardware.tidaservice\",\n    ]\n    patterns = [\n        r\"bin/fidoca(@[0-9]+\\.[0-9]+)?$\",\n        r\"bin/mlipayd(@[0-9]+\\.[0-9]+)?$\",\n        r\"bin/mtd(@[0-9]+\\.[0-9]+)?$\",\n        r\"bin/tidad(@[0-9]+\\.[0-9]+)?$\",\n    ]\n\n\nclass PaymentFirmwareSection(Section):\n    name = \"Payment firmware\"\n    patterns = [\n        r\"(.*/)?firmware/alipay\\..*\",\n        r\"(.*/)?firmware/fidoctap\\..*\",\n        r\"(.*/)?firmware/fidotap\\..*\",\n    ]\n\n\nregister_section(PaymentEIDSection)\nregister_section(PaymentIFAASection)\nregister_section(PaymentOplusSection)\nregister_section(PaymentXiaomiSection)\nregister_section(PaymentFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/perf.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass PerfSection(Section):\n    name = \"Perf\"\n    interfaces = [\n        \"vendor.qti.hardware.perf\",\n    ]\n    libraries = [\n        \"libqti-perfd-client\",\n    ]\n    filenames = [\n        \"powerhint.xml\",\n    ]\n    folders = [\n        \"etc/perf\",\n    ]\n    properties_prefixes = {\n        \"ro.vendor.extension_library\": True,\n    }\n\n\nclass PerfIopSection(Section):\n    name = \"Perf IOP\"\n    interfaces = [\n        \"vendor.qti.hardware.iop\",\n    ]\n    libraries = [\n        \"libqti-iopd-client\",\n    ]\n\n\nregister_section(PerfSection)\nregister_section(PerfIopSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/power.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass PowerSection(Section):\n    name = \"Power\"\n    interfaces = [\n        \"android.hardware.power\",\n        \"vendor-oplus-hardware-power-powermonitor\",\n        \"vendor.qti.hardware.power.powermodule\",\n        \"vendor.mediatek.hardware.mtkpower\",\n    ]\n    hardware_modules = [\n        \"power\",\n    ]\n    properties_prefixes = {\n        \"vendor.power.\": False,\n    }\n\n\nclass PowerConfigsSection(Section):\n    name = \"Power configs\"\n    folders = [\n        \"etc/pwr\",\n    ]\n\n\nregister_section(PowerSection)\nregister_section(PowerConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/qcc.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass QccSection(Section):\n    name = \"QCC\"\n    interfaces = [\n        \"vendor.qti.hardware.qccsyshal\",\n        \"vendor.qti.hardware.qccvndhal\",\n        \"vendor.qti.qccvndhal_aidl\",\n    ]\n    binaries = [\n        \"qcc-vendor\",\n    ]\n\n\nregister_section(QccSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/qesd.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass QesdSection(Section):\n    name = \"QESD\"\n    interfaces = [\n        \"vendor.qti.qesdhal\",\n        \"vendor.qti.qesdhalaidl\",\n        \"vendor.qti.qesdsys\",\n    ]\n    binaries = [\n        \"perf_qesdk_client\",\n        \"qesdk-manager\",\n        \"sensors-qesdk\",\n    ]\n\n\nregister_section(QesdSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/qspm.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass QspmSection(Section):\n    name = \"QSPM\"\n    interfaces = [\n        \"vendor.qti.qspmhal\",\n    ]\n    filenames = [\n        \"qspm.policy\",\n    ]\n\n\nregister_section(QspmSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/qvr.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass QvrSection(Section):\n    name = \"QVR\"\n    interfaces = [\n        \"vendor.qti.hardware.qvr\",\n    ]\n    binaries = [\n        \"qvrdatalogger\",\n        \"qvrservice\",\n        \"qvrservicetest\",\n        \"qvrservicetest64\",\n    ]\n    folders = [\n        \"etc/qvr\",\n    ]\n\n\nregister_section(QvrSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/qxr.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass QxrSection(Section):\n    name = \"QXR\"\n    interfaces = [\n        \"vendor.qti.hardware.qxr\",\n    ]\n\n\nregister_section(QxrSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/radio.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass RadioSection(Section):\n    name = \"Radio\"\n    interfaces = [\n        \"android.hardware.radio\",\n        \"mtkfusionrild\",\n        \"qcrild\",\n        \"qcrilNrd\",\n        \"rild\",\n        \"vendor.mediatek.hardware.mtkradioex\",\n        \"vendor.mediatek.hardware.nwk_opt\",\n        \"vendor.mediatek.hardware.radio\",\n        \"vendor.oplus.hardware.appradioaidl\",\n        \"vendor.oplus.hardware.esim\",\n        \"vendor.oplus.hardware.radio\",\n        \"vendor.qti.hardware.embmssl\",\n        \"vendor.qti.hardware.embmsslaidl\",\n        \"vendor.qti.hardware.radio.am\",\n        \"vendor.qti.hardware.radio.atcmdfwd\",\n        \"vendor.qti.hardware.radio.common\",\n        \"vendor.qti.hardware.radio.internal.deviceinfo\",\n        \"vendor.qti.hardware.radio.lpa\",\n        \"vendor.qti.hardware.radio.qcrilhook\",\n        \"vendor.qti.hardware.radio.qtiradio\",\n        \"vendor.qti.hardware.radio.qtiradioconfig\",\n        \"vendor.qti.hardware.radio.uim\",\n        \"vendor.qti.hardware.radio.uim_remote_client\",\n        \"vendor.qti.hardware.radio.uim_remote_server\",\n        \"vendor.qti.rmt_storage\",\n        \"vendor.qti.tftp\",\n    ]\n    hardware_modules = [\n        \"radio\",\n    ]\n    apps = [\n        \"IWlanService\",\n        \"QtiTelephonyService\",\n        \"qcrilmsgtunnel\",\n    ]\n    binaries = [\n        \"ATFWD-daemon\",\n        \"adpl\",\n        \"ccci_mdinit\",\n        \"ccci_rpcd\",\n        \"gsm0710muxd\",\n        \"ks\",\n        \"mdm_helper\",\n        \"netmgrd\",\n        \"pd-mapper\",\n        \"port-bridge\",\n        \"qrtr-cfg\",\n        \"qrtr-lookup\",\n        \"qrtr-ns\",\n        \"qti\",\n        \"rmt_storage\",\n        \"ssgtzd\",\n        \"tftp_server\",\n        \"xcap\",\n    ]\n    filenames = [\n        \"init-qcril-data.rc\",\n        \"init.md_apps.rc\",\n    ]\n    folders = [\n        \"etc/qcril_database\",\n        \"radio/qcril_database\",\n    ]\n    patterns = [\n        r\"etc/init/init.ccci.*\\.rc\",\n        r\"etc/init/data.*.\\.rc\",\n        r\"etc/seccomp_policy/atfwd(@[0-9]+\\.[0-9]+)?.policy\",\n    ]\n    properties_prefixes = {\n        \"persist.radio.\": False,\n        \"persist.rild.\": False,\n        \"persist.vendor.mdm_helper.\": False,\n        \"persist.vendor.radio.\": False,\n        \"ril.\": False,\n        \"rild.\": False,\n        \"ro.radio.\": False,\n        \"ro.telephony.\": False,\n        \"telephony.\": False,\n    }\n\n\nclass RadioImsSection(Section):\n    name = \"Radio (IMS)\"\n    interfaces = [\n        \"com.qualcomm.qti.imscmservice\",\n        \"com.qualcomm.qti.uceservice\",\n        \"vendor.mediatek.hardware.rcs\",\n        \"vendor.mediatek.hardware.videotelephony\",\n        \"vendor.oplus.hardware.ims\",\n        \"vendor.qti.hardware.radio.ims\",\n        \"vendor.qti.ims.callcapability\",\n        \"vendor.qti.ims.callinfo\",\n        \"vendor.qti.ims.factory\",\n        \"vendor.qti.ims.rcsconfig\",\n        \"vendor.qti.imsrtpservice\",\n    ]\n    apps = [\n        \"ims\",\n    ]\n    binaries = [\n        \"bip\",\n        \"charon\",\n        \"epdg_wod\",\n        \"ims_rtp_daemon\",\n        \"imsdatadaemon\",\n        \"imsqmidaemon\",\n        \"imsrcsd\",\n        \"ipsec_mon\",\n        \"rcs_volte_stack\",\n        \"starter\",\n        \"stroke\",\n        \"volte_clientapi_ua\",\n        \"volte_imcb\",\n        \"volte_imsm_93\",\n        \"volte_md_status\",\n        \"volte_rcs_ua\",\n        \"volte_stack\",\n        \"volte_ua\",\n        \"vtservice_hidl\",\n    ]\n    libraries = [\n        \"lib-rcsconfig\",\n        \"lib-siputility\",\n        \"lib-uceservice\",\n    ]\n    filenames = [\n        \"imsrtp.policy\",\n        \"init.wod.rc\",\n    ]\n    patterns = [\n        r\"lib(64)?/lib-ims.*.\\.so\",\n    ]\n    properties_prefixes = {\n        \"persist.vendor.ims.\": False,\n    }\n\n\nregister_section(RadioSection)\nregister_section(RadioImsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/rebootescrow.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass RebootEscrowSection(Section):\n    name = \"Reboot escrow\"\n    interfaces = [\n        \"android.hardware.rebootescrow\",\n    ]\n\n\nregister_section(RebootEscrowSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/renderscript.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass RenderscriptSection(Section):\n    name = \"RenderScript\"\n    interfaces = [\n        \"android.hardware.renderscript\",\n    ]\n    libraries = [\n        \"libRSDriver_adreno\",\n        \"librs_adreno\",\n        \"librs_adreno_sha1\",\n    ]\n\n\nregister_section(RenderscriptSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/secure_element.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SecureElementSection(Section):\n    name = \"Secure element\"\n    interfaces = [\n        \"android.hardware.secure_element\",\n        \"vendor.qti.secure_element\",\n    ]\n\n\nclass SecureElementPowerManagerSection(Section):\n    name = \"Secure element (power manager)\"\n    interfaces = [\n        \"vendor.qti.esepowermanager\",\n    ]\n\n\nregister_section(SecureElementSection)\nregister_section(SecureElementPowerManagerSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/security.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SecuritySection(Section):\n    name = \"Security\"\n    interfaces = [\n        \"android.hardware.security.keymint\",\n        \"android.hardware.security.rkp\",\n        \"android.hardware.security.secureclock\",\n        \"android.hardware.security.sharedsecret\",\n    ]\n\n\nregister_section(SecuritySection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/sensors.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SensorsSection(Section):\n    name = \"Sensors\"\n    interfaces = [\n        \"android.hardware.sensors\",\n        \"motorola.hardware.sensorscalibrate\",\n        \"vendor-oplus-hardware-oplusSensor\",\n        \"vendor.qti.hardware.sensorscalibrate\",\n    ]\n    hardware_modules = [\n        \"sensors\",\n    ]\n    binaries = [\n        \"init.qcom.sensors.sh\",\n        \"sensors.qti\",\n        \"sscrpcd\",\n    ]\n    patterns = [\n        r\"lib(64)?/sensors\\..*\\.so\",\n    ]\n    properties_prefixes = {\n        \"persist.vendor.sensor.\": False,\n        \"persist.vendor.sensors.\": False,\n    }\n\n\nclass SensorsConfigsSection(Section):\n    name = \"Sensors configs\"\n    folders = [\n        \"etc/motorola/sensors\",\n        \"etc/sensor\",\n        \"etc/sensors\",\n    ]\n\n\nregister_section(SensorsSection)\nregister_section(SensorsConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/servicetracker.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass ServicetrackerSection(Section):\n    name = \"Service tracker\"\n    interfaces = [\n        \"vendor.qti.hardware.servicetracker\",\n    ]\n\n\nregister_section(ServicetrackerSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/sla.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SlaSection(Section):\n    name = \"SLA\"\n    interfaces = [\n        \"vendor.qti.sla.service\",\n    ]\n\n\nregister_section(SlaSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/soter.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SoterSection(Section):\n    name = \"Soter\"\n    interfaces = [\n        \"vendor.microtrust.hardware.soter\",\n        \"vendor.qti.hardware.soter\",\n    ]\n    apps = [\n        \"SoterService\",\n    ]\n\n\nregister_section(SoterSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/soundtrigger.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass SoundtriggerSection(Section):\n    name = \"Soundtrigger\"\n    interfaces = [\n        \"android.hardware.soundtrigger\",\n        \"android.hardware.soundtrigger3\",\n        \"vendor.qti.voiceprint\",\n    ]\n    hardware_modules = [\n        \"sound_trigger\",\n    ]\n    properties_prefixes = {\n        \"ro.vendor.audio.soundtrigger\": False,\n    }\n\n\nregister_section(SoundtriggerSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/storage.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass StorageFirmwareSection(Section):\n    name = \"Storage firmware\"\n    folders = [\n        \"firmware/ufs\",\n    ]\n\n\nregister_section(StorageFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/tetheroffload.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass TetherOffloadSection(Section):\n    name = \"Tether offload\"\n    interfaces = [\n        \"android.hardware.tetheroffload\",\n        \"android.hardware.tetheroffload.config\",\n        \"android.hardware.tetheroffload.control\",\n    ]\n    binaries = [\n        \"tetheroffloadservice\",\n    ]\n\n\nregister_section(TetherOffloadSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/thermal.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass ThermalSection(Section):\n    name = \"Thermal\"\n    interfaces = [\n        \"android.hardware.thermal\",\n    ]\n    hardware_modules = [\n        \"thermal\",\n    ]\n    properties_prefixes = {\n        \"vendor.sys.thermal.\": False,\n    }\n\n\nclass ThermalQcomSection(Section):\n    name = \"Thermal (Qualcomm)\"\n    interfaces = [\n        \"vendor.qti.hardware.limits\",\n    ]\n    binaries = [\n        \"thermal-engine\",\n    ]\n    libraries = [\n        \"libthermalclient\",\n    ]\n\n\nclass ThermalXiaomiSection(Section):\n    name = \"Thermal (Xiaomi)\"\n    binaries = [\n        \"mi_thermald\",\n    ]\n\n\nclass ThermalConfigsSection(Section):\n    name = \"Thermal configs\"\n    folders = [\"etc/temperature_profile\"]\n    patterns = [\n        r\"etc/thermal.*.\\.conf\",\n    ]\n\n\nregister_section(ThermalSection)\nregister_section(ThermalQcomSection)\nregister_section(ThermalXiaomiSection)\nregister_section(ThermalConfigsSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/time.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass TimeSection(Section):\n    name = \"Time services\"\n    apps = [\n        \"TimeService\",\n    ]\n    binaries = [\n        \"time_daemon\",\n    ]\n    libraries = [\n        \"libtime_genoff\",\n    ]\n\n\nregister_section(TimeSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/touch.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass TouchHbtpSection(Section):\n    name = \"Touch (HBTP)\"\n    interfaces = [\n        \"vendor.qti.hardware.improvetouch.touchcompanion\",\n    ]\n    binaries = [\n        \"hbtp_daemon\",\n    ]\n    folders = [\n        \"etc/hbtp\",\n    ]\n\n\nclass TouchOplusSection(Section):\n    name = \"Touch (oplus)\"\n    interfaces = [\n        \"vendor-oplus-hardware-touch\",\n    ]\n\n\nclass TouchXiaomiSection(Section):\n    name = \"Touch (Xiaomi)\"\n    interfaces = [\n        \"vendor.xiaomi.hardware.touchfeature\",\n    ]\n    properties_prefixes = {\n        \"ro.vendor.touchfeature.\": False,\n    }\n\n\nclass TouchFirmwareSection(Section):\n    name = \"Touch firmware\"\n    folders = [\n        \"firmware/tp\",\n    ]\n\n\nregister_section(TouchHbtpSection)\nregister_section(TouchOplusSection)\nregister_section(TouchXiaomiSection)\nregister_section(TouchFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/trusted_ui.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass TrustedUiSection(Section):\n    name = \"Trusted UI\"\n    interfaces = [\n        \"vendor.qti.hardware.trustedui\",\n        \"vendor.qti.hardware.tui_comm\",\n        \"vendor.trustonic.tee.tui\",\n    ]\n    binaries = [\n        \"TrustedUISampleTest\",\n    ]\n    libraries = [\n        \"libTrustedUI\",\n        \"libTrustedUIAIDL\",\n        \"libTrustedUITZ\",\n        \"libTrustedUIVM\",\n    ]\n\n\nregister_section(TrustedUiSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/tv.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass TvSection(Section):\n    name = \"TV\"\n    interfaces = [\n        \"android.hardware.tv.cec\",\n        \"android.hardware.tv.input\",\n        \"android.hardware.tv.tuner\",\n    ]\n    hardware_modules = [\n        \"tv_input\",\n    ]\n\n\nregister_section(TvSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/usb.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass UsbSection(Section):\n    name = \"USB\"\n    interfaces = [\n        \"android.hardware.usb\",\n    ]\n    properties_prefixes = {\n        \"vendor.usb.\": False,\n    }\n\n\nregister_section(UsbSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/uwb.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass UwbSection(Section):\n    name = \"UWB\"\n    interfaces = [\n        \"android.hardware.uwb\",\n        \"android.hardware.uwb.fira_android\",\n    ]\n\n\nregister_section(UwbSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/vibrator.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass VibratorSection(Section):\n    name = \"Vibrator\"\n    interfaces = [\n        \"android.hardware.vibrator\",\n        \"motorola.hardware.vibrator\",\n        \"vendor.asus.vibrator.vibratorgovern\",\n        \"vendor.oplus.hardware.vibrator\",\n        \"vendor.qti.hardware.vibrator\",\n        \"vendor.xiaomi.hardware.vibratorfeature\",\n    ]\n    hardware_modules = [\n        \"vibrator\",\n    ]\n\n\nclass VibratorFirmwareSection(Section):\n    name = \"Vibrator firmware\"\n    folders = [\n        \"etc/vibrator\",\n    ]\n    patterns = [\n        r\"(.*/)?firmware/.*(rtp|RTP)\\.bin\",\n        r\"(.*/)?firmware/aw8622x.*\\.bin\",\n        r\"(.*/)?firmware/aw8697.*\\.bin\",\n    ]\n\n\nregister_section(VibratorSection)\nregister_section(VibratorFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/vr.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass VrSection(Section):\n    name = \"VR\"\n    interfaces = [\n        \"android.hardware.vr\",\n    ]\n    hardware_modules = [\n        \"vr\",\n    ]\n\n\nregister_section(VrSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/weaver.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass WeaverSection(Section):\n    name = \"Weaver\"\n    interfaces = [\n        \"android.hardware.weaver\",\n    ]\n\n\nregister_section(WeaverSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/wifi.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass WifiSection(Section):\n    name = \"Wi-Fi\"\n    interfaces = [\n        \"android.hardware.wifi\",\n        \"vendor.asus.wifi.netutil\",\n        \"vendor.asus.wifi.rttutil\",\n        \"vendor.ims.wifiantennamode\",\n        \"vendor.mediatek.hardware.wifi.hostapd\",\n        \"vendor.mediatek.hardware.wifi.supplicant\",\n        \"vendor.oplus.hardware.wifi\",\n        \"vendor.oplus.hardware.wifi-aidl\",\n        \"vendor.qti.hardware.fstman\",\n        \"vendor.qti.hardware.wifi.hostapd\",\n        \"vendor.qti.hardware.wifi.keystore\",\n        \"vendor.qti.hardware.wifi.supplicant\",\n        \"vendor.qti.hardware.wifi.wifilearner\",\n        \"vendor.qti.hardware.wigig.netperftuner\",\n        \"vendor.qti.hardware.wigig.supptunnel\",\n    ]\n    binaries = [\n        \"cnss-daemon\",\n        \"hostapd\",\n        \"hostapd_cli\",\n        \"wcnss_service\",\n        \"wlan_assistant\",\n        \"wmt_launcher\",\n        \"wmt_loader\",\n        \"wpa_cli\",\n        \"wpa_supplicant\",\n    ]\n    filenames = [\n        \"init.wlan_drv.rc\",\n    ]\n    libraries = [\n        \"libwifi-hal-qcom\",\n    ]\n    properties_prefixes = {\n        \"ro.hardware.wlan.\": False,\n        \"ro.wifi.\": False,\n        \"ro.wlan.\": False,\n        \"wifi.\": False,\n    }\n\n\nclass WifiConfigsSection(Section):\n    name = \"Wi-Fi configs\"\n    folders = [\n        \"etc/wifi\",\n    ]\n\n\nclass WifiFirmwareSection(Section):\n    name = \"Wi-Fi firmware\"\n    folders = [\n        \"firmware/wigig\",\n        \"firmware/wlan\",\n    ]\n\n\nregister_section(WifiSection)\nregister_section(WifiConfigsSection)\nregister_section(WifiFirmwareSection)\n"
  },
  {
    "path": "aospdtgen/proprietary_files/sections/wifidisplay.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom aospdtgen.proprietary_files.section import Section, register_section\n\n\nclass WifiDisplaySection(Section):\n    name = \"Wi-Fi Display\"\n    interfaces = [\n        \"com.qualcomm.qti.wifidisplayhal\",\n        \"vendor.qti.hardware.sigma_miracast\",\n        \"vendor.qti.hardware.wifidisplaysession\",\n    ]\n    apps = [\n        \"WfdService\",\n    ]\n    binaries = [\n        \"wfdhdcphalservice\",\n        \"wfdservice\",\n        \"wfdvndservice\",\n        \"wifidisplayhalservice\",\n    ]\n    libraries = [\n        \"libmiracast\",\n    ]\n    filenames = [\n        \"wfdconfig.xml\",\n        \"wifidisplayhalservice.policy\",\n    ]\n    patterns = [\n        r\"etc/seccomp_policy/wfd.*.service\\.policy\",\n    ]\n    properties_prefixes = {\n        \"persist.debug.wfd.\": False,\n        \"persist.sys.wfd.\": False,\n    }\n\n\nregister_section(WifiDisplaySection)\n"
  },
  {
    "path": "aospdtgen/templates/Android.bp.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\nsoong_namespace {\n}\n\n"
  },
  {
    "path": "aospdtgen/templates/Android.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\nLOCAL_PATH := $(call my-dir)\n\nifeq ($(TARGET_DEVICE),{{ device_info.codename }})\ninclude $(call all-subdir-makefiles,$(LOCAL_PATH))\nendif\n\n"
  },
  {
    "path": "aospdtgen/templates/AndroidProducts.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\nPRODUCT_MAKEFILES := \\\n    $(LOCAL_DIR)/lineage_{{ device_info.codename }}.mk\n\nCOMMON_LUNCH_CHOICES := \\\n    lineage_{{ device_info.codename }}-user \\\n    lineage_{{ device_info.codename }}-userdebug \\\n    lineage_{{ device_info.codename }}-eng\n\n"
  },
  {
    "path": "aospdtgen/templates/BoardConfig.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\nDEVICE_PATH := device/{{ device_info.manufacturer }}/{{ device_info.codename }}\n\n{% if device_info.device_is_ab %}\n# A/B\nAB_OTA_UPDATER := true\nAB_OTA_PARTITIONS +=\n{%- for partition in fstab.get_ab_partitions_models() %} \\\n    {{ partition.name }}\n{%- endfor %}\n\nBOARD_USES_RECOVERY_AS_BOOT := true\n\n{% endif %}\n# Architecture\nTARGET_ARCH := {{ device_info.arch.arch }}\nTARGET_ARCH_VARIANT := {{ device_info.arch.arch_variant }}\nTARGET_CPU_ABI := {{ device_info.arch.cpu_abi }}\nTARGET_CPU_ABI2 := {{ device_info.arch.cpu_abi2 }}\nTARGET_CPU_VARIANT := generic\nTARGET_CPU_VARIANT_RUNTIME := {{ device_info.cpu_variant }}\n\n{% if device_info.second_arch %}\nTARGET_2ND_ARCH := {{ device_info.second_arch.arch }}\nTARGET_2ND_ARCH_VARIANT := {{ device_info.second_arch.arch_variant }}\nTARGET_2ND_CPU_ABI := {{ device_info.second_arch.cpu_abi }}\nTARGET_2ND_CPU_ABI2 := {{ device_info.second_arch.cpu_abi2 }}\nTARGET_2ND_CPU_VARIANT := generic\nTARGET_2ND_CPU_VARIANT_RUNTIME := {{ device_info.second_cpu_variant }}\n\n{% endif %}\n{% if device_info.arch.bitness != 64 %}\nTARGET_USES_64_BIT_BINDER := true\n\n{% endif %}\n{% if not device_info.device_uses_updatable_apex %}\n# APEX\nOVERRIDE_TARGET_FLATTEN_APEX := true\n\n{% endif %}\n# Bootloader\n{% if device_info.bootloader_board_name %}\nTARGET_BOOTLOADER_BOARD_NAME := {{ device_info.bootloader_board_name }}\n{% endif %}\nTARGET_NO_BOOTLOADER := true\n\n{% if device_info.screen_density or device_info.use_vulkan %}\n# Display\n{% if device_info.screen_density %}\nTARGET_SCREEN_DENSITY := {{ device_info.screen_density }}\n{% endif %}\n{% if device_info.use_vulkan %}\nTARGET_USES_VULKAN := true\n{% endif %}\n\n{% endif %}\n# Kernel\n{% if boot_configuration.boot_image_info.header_version != \"0\" %}\nBOARD_BOOT_HEADER_VERSION := {{ boot_configuration.boot_image_info.header_version }}\n{% endif %}\n{% if boot_configuration.base_address %}\nBOARD_KERNEL_BASE := {{ boot_configuration.base_address }}\n{% endif %}\n{% if boot_configuration.cmdline %}\nBOARD_KERNEL_CMDLINE := {{ boot_configuration.cmdline }}\n{% endif %}\n{% if boot_configuration.pagesize %}\nBOARD_KERNEL_PAGESIZE := {{ boot_configuration.pagesize }}\n{% endif %}\n{% if boot_configuration.boot_image_info.header_version != \"0\" %}\nBOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)\n{% endif %}\nBOARD_KERNEL_IMAGE_NAME := Image\n{% if boot_configuration.dt %}\nBOARD_KERNEL_SEPARATED_DT := true\n{% endif %}\n{% if boot_configuration.dtb %}\nBOARD_INCLUDE_DTB_IN_BOOTIMG := true\n{% endif %}\n{% if boot_configuration.dtbo %}\nBOARD_KERNEL_SEPARATED_DTBO := true\n{% endif %}\nTARGET_KERNEL_CONFIG := {{ device_info.codename }}_defconfig\nTARGET_KERNEL_SOURCE := kernel/{{ device_info.manufacturer }}/{{ device_info.codename }}\n\n# Kernel - prebuilt\nTARGET_FORCE_PREBUILT_KERNEL := true\nifeq ($(TARGET_FORCE_PREBUILT_KERNEL),true)\nTARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilts/kernel\n{% if boot_configuration.dt %}\nTARGET_PREBUILT_DT := $(DEVICE_PATH)/prebuilts/dt.img\nBOARD_MKBOOTIMG_ARGS += --dt $(TARGET_PREBUILT_DT)\nBOARD_KERNEL_SEPARATED_DT := \n{% endif %}\n{% if boot_configuration.dtb %}\nTARGET_PREBUILT_DTB := $(DEVICE_PATH)/prebuilts/dtb.img\nBOARD_MKBOOTIMG_ARGS += --dtb $(TARGET_PREBUILT_DTB)\nBOARD_INCLUDE_DTB_IN_BOOTIMG := \n{% endif %}\n{% if boot_configuration.dtbo %}\nBOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilts/dtbo.img\nBOARD_KERNEL_SEPARATED_DTBO := \n{% endif %}\nendif\n\n# Partitions\n{% if device_info.device_uses_system_as_root %}\nBOARD_BUILD_SYSTEM_ROOT_IMAGE := true\n{% endif %}\n{% if boot_configuration.pagesize %}\nBOARD_FLASH_BLOCK_SIZE := {{ boot_configuration.pagesize|int * 64 }} # (BOARD_KERNEL_PAGESIZE * 64)\n{% endif %}\nBOARD_BOOTIMAGE_PARTITION_SIZE := {{ boot_configuration.boot_image_info.origsize }}\n{% if boot_configuration.dtbo %}\nBOARD_DTBOIMG_PARTITION_SIZE := {{ boot_configuration.dtbo.stat().st_size }}\n{% endif %}\n{% if boot_configuration.recovery_image_info %}\nBOARD_RECOVERYIMAGE_PARTITION_SIZE := {{ boot_configuration.recovery_image_info.origsize }}\n{% endif %}\n{% if boot_configuration.init_boot_image_info %}\nBOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := {{ boot_configuration.init_boot_image_info.origsize }}\n{% endif %}\n{% if boot_configuration.vendor_boot_image_info %}\nBOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := {{ boot_configuration.vendor_boot_image_info.origsize }}\n{% endif %}\n{% if boot_configuration.vendor_kernel_boot_image_info %}\nBOARD_VENDOR_KERNEL_BOOTIMAGE_PARTITION_SIZE := {{ boot_configuration.vendor_kernel_boot_image_info.origsize }}\n{% endif %}\n{% if device_info.device_uses_dynamic_partitions %}\nBOARD_SUPER_PARTITION_SIZE := 9126805504 # TODO: Fix hardcoded value\nBOARD_SUPER_PARTITION_GROUPS := {{ device_info.manufacturer }}_dynamic_partitions\nBOARD_{{ device_info.manufacturer|upper }}_DYNAMIC_PARTITIONS_PARTITION_LIST :=\n{%- for partition in fstab.get_logical_partitions_models() %} \\\n    {{ partition.name }}\n{%- endfor %}\n\nBOARD_{{ device_info.manufacturer|upper }}_DYNAMIC_PARTITIONS_SIZE := 9122611200 # TODO: Fix hardcoded value\n{% endif %}\n\n# Platform\nTARGET_BOARD_PLATFORM := {{ device_info.platform }}\n\n# Properties{{ '\\n' }}\n{%- for partition in partitions.get_all_partitions() %}\n{% if partition.build_prop %}\nTARGET_{{ partition.model.name|upper }}_PROP += $(DEVICE_PATH)/{{ partition.model.name }}.prop\n{% endif %}\n{% endfor %}\n\n# Recovery\nTARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/{{ fstab.fstab.name }}\n{% if boot_configuration.dtbo and not device_info.device_is_ab %}\nBOARD_INCLUDE_RECOVERY_DTBO := true\n{% endif %}\n{% if device_info.device_pixel_format %}\nTARGET_RECOVERY_PIXEL_FORMAT := {{ device_info.device_pixel_format }}\n{% endif %}\nTARGET_USERIMAGES_USE_EXT4 := true\nTARGET_USERIMAGES_USE_F2FS := true\n\n{% if device_info.vendor_build_security_patch %}\n# Security patch level\nVENDOR_SECURITY_PATCH := {{ device_info.vendor_build_security_patch }}\n\n{% endif %}\n{% if boot_configuration.boot_image_info.sigtype == \"AVBv2\" %}\n# Verified Boot\nBOARD_AVB_ENABLE := true\nBOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3\n{% if boot_configuration.recovery_image_info\n      and boot_configuration.recovery_image_info.sigtype == \"AVBv2\" %}\nBOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem\nBOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096\nBOARD_AVB_RECOVERY_ROLLBACK_INDEX := 1\nBOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1\n{% endif %}\n{% if boot_configuration.vendor_boot_image_info\n      and boot_configuration.vendor_boot_image_info.sigtype == \"AVBv2\" %}\nBOARD_AVB_VENDOR_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem\nBOARD_AVB_VENDOR_BOOT_ALGORITHM := SHA256_RSA4096\nBOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX := 1\nBOARD_AVB_VENDOR_BOOT_ROLLBACK_INDEX_LOCATION := 1\n{% endif %}\n{% if boot_configuration.vendor_kernel_boot_image_info\n      and boot_configuration.vendor_kernel_boot_image_info.sigtype == \"AVBv2\" %}\nBOARD_AVB_VENDOR_KERNEL_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem\nBOARD_AVB_VENDOR_KERNEL_BOOT_ALGORITHM := SHA256_RSA4096\nBOARD_AVB_VENDOR_KERNEL_BOOT_ROLLBACK_INDEX := 1\nBOARD_AVB_VENDOR_KERNEL_BOOT_ROLLBACK_INDEX_LOCATION := 1\n{% endif %}\n\n{% endif %}\n# VINTF\nDEVICE_MANIFEST_FILE += $(DEVICE_PATH)/manifest.xml\n{% if proprietary_files_list is not none %}\n\n# Inherit the proprietary files\ninclude vendor/{{ device_info.manufacturer }}/{{ device_info.codename }}/BoardConfigVendor.mk\n{% endif %}\n\n"
  },
  {
    "path": "aospdtgen/templates/LICENSE.jinja2",
    "content": "{{ comment_prefix }}\n{{ comment_prefix }} SPDX-FileCopyrightText: The LineageOS Project\n{{ comment_prefix }} SPDX-License-Identifier: Apache-2.0\n{{ comment_prefix }}\n\n"
  },
  {
    "path": "aospdtgen/templates/README.md.jinja2",
    "content": "# Android device tree for {{ device_info.brand }} {{ device_info.model }} ({{ device_info.codename }})\n\n```\n{% include 'LICENSE.jinja2' %}\n```\n\n"
  },
  {
    "path": "aospdtgen/templates/__init__.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\"\"\"aospdtgen templates utils.\"\"\"\n\nfrom jinja2 import Environment, FileSystemLoader\nfrom pathlib import Path\nfrom typing import Any, Optional\n\nfrom aospdtgen import module_path\n\njinja_env = Environment(\n    loader=FileSystemLoader(module_path / \"templates\"),\n    autoescape=True,\n    trim_blocks=True,\n    lstrip_blocks=True,\n)\n\n\ndef render_template(\n    path: Optional[Path],\n    template_file: str,\n    out_file: str = \"\",\n    to_file: bool = True,\n    **kwargs: Any,\n):\n    template = jinja_env.get_template(f\"{template_file}.jinja2\")\n    rendered_template = template.render(**kwargs)\n\n    if to_file:\n        if not out_file:\n            out_file = template_file\n\n        with open(f\"{path}/{out_file}\", \"w\", encoding=\"utf-8\") as out:\n            out.write(rendered_template)\n\n    return rendered_template\n"
  },
  {
    "path": "aospdtgen/templates/device.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\n{% if device_info.device_uses_updatable_apex %}\n# Enable updating of APEXes\n$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)\n\n{% endif %}\n{% if device_info.device_is_ab %}\n# A/B\n{% if device_info.device_uses_virtual_ab %}\n$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk)\n\n{% endif %}\nPRODUCT_PACKAGES += \\\n    android.hardware.boot@1.2-impl \\\n    android.hardware.boot@1.2-impl.recovery \\\n    android.hardware.boot@1.2-service\n\nPRODUCT_PACKAGES += \\\n    update_engine \\\n    update_engine_sideload \\\n    update_verifier\n\n{% if partitions.system.fstab_entry and partitions.system.fstab_entry.is_slotselect() %}\nAB_OTA_POSTINSTALL_CONFIG += \\\n    RUN_POSTINSTALL_system=true \\\n    POSTINSTALL_PATH_system=system/bin/otapreopt_script \\\n    FILESYSTEM_TYPE_system={{ partitions.system.fstab_entry.fs_type }} \\\n    POSTINSTALL_OPTIONAL_system=true\n\n{% endif %}\n{% if partitions.vendor.fstab_entry and partitions.vendor.fstab_entry.is_slotselect() %}\nAB_OTA_POSTINSTALL_CONFIG += \\\n    RUN_POSTINSTALL_vendor=true \\\n    POSTINSTALL_PATH_vendor=bin/checkpoint_gc \\\n    FILESYSTEM_TYPE_vendor={{ partitions.vendor.fstab_entry.fs_type }} \\\n    POSTINSTALL_OPTIONAL_vendor=true\n\n{% endif %}\nPRODUCT_PACKAGES += \\\n    checkpoint_gc \\\n    otapreopt_script\n\n{% endif %}\n{% if device_info.board_shipping_api_level or device_info.first_api_level %}\n# API levels\n{% if device_info.board_shipping_api_level %}\nBOARD_SHIPPING_API_LEVEL := {{ device_info.board_shipping_api_level }}\n{% endif %}\n{% if device_info.first_api_level %}\nPRODUCT_SHIPPING_API_LEVEL := {{ device_info.first_api_level }}\n{% endif %}\n\n{% endif %}\n{% if device_info.device_uses_dynamic_partitions %}\n# fastbootd\nPRODUCT_PACKAGES += \\\n    android.hardware.fastboot@1.1-impl-mock \\\n    fastbootd\n\n{% endif %}\n# Health\nPRODUCT_PACKAGES += \\\n    android.hardware.health@2.1-impl \\\n{% if not device_info.device_is_ab %}\n    android.hardware.health@2.1-impl.recovery \\\n{% endif %}\n    android.hardware.health@2.1-service\n\n{% if device_info.enable_uffd_gc is not none %}\n# Kernel\nPRODUCT_ENABLE_UFFD_GC := {{ device_info.enable_uffd_gc|string|lower }}\n\n{% endif %}\n# Overlays\nPRODUCT_ENFORCE_RRO_TARGETS := *\n\n{% if device_info.device_uses_dynamic_partitions %}\n# Partitions\nPRODUCT_USE_DYNAMIC_PARTITIONS := true\n\n{% endif %}\n{% if device_info.product_characteristics %}\n# Product characteristics\nPRODUCT_CHARACTERISTICS := {{ device_info.product_characteristics }}\n\n{% endif %}\n# Rootdir\nPRODUCT_PACKAGES += \\{{ '\\n' }}\n{%- for file in rootdir_bin_files %}\n    {{ file.name }} \\\n{% endfor %}\n\nPRODUCT_PACKAGES += \\\n    {{ fstab.fstab.name }} \\{{ '\\n' }}\n{%- for file in rootdir_etc_files %}\n    {{ file.name }} \\\n{% endfor %}\n{%- for file in rootdir_recovery_etc_files %}\n    {{ file.name }} \\\n{% endfor %}\n\n{% if device_info.device_uses_dynamic_partitions %}\nPRODUCT_COPY_FILES += \\\n{% if device_info.device_uses_virtual_ab %}\n    $(LOCAL_PATH)/rootdir/etc/{{ fstab.fstab.name }}:$(TARGET_VENDOR_RAMDISK_OUT)/first_stage_ramdisk/{{ fstab.fstab.name }}\n{% else %}\n    $(LOCAL_PATH)/rootdir/etc/{{ fstab.fstab.name }}:$(TARGET_COPY_OUT_RAMDISK)/{{ fstab.fstab.name }}\n{% endif %}\n\n{% endif %}\n# Soong namespaces\nPRODUCT_SOONG_NAMESPACES += \\\n    $(LOCAL_PATH)\n{% if proprietary_files_list is not none %}\n\n# Inherit the proprietary files\n$(call inherit-product, vendor/{{ device_info.manufacturer }}/{{ device_info.codename }}/{{ device_info.codename }}-vendor.mk)\n{% endif %}\n\n"
  },
  {
    "path": "aospdtgen/templates/extract-files.py.jinja2",
    "content": "#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3\n#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom extract_utils.main import (\n    ExtractUtils,\n    ExtractUtilsModule,\n)\n\nnamespace_imports = [\n    'device/{{ device_info.manufacturer }}/{{ device_info.codename }}',\n]\n\nmodule = ExtractUtilsModule(\n    '{{ device_info.codename }}',\n    '{{ device_info.manufacturer }}',\n    namespace_imports=namespace_imports,\n)\n\nif __name__ == '__main__':\n    utils = ExtractUtils.device(module)\n    utils.run()\n\n"
  },
  {
    "path": "aospdtgen/templates/lineage_device.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\n# Inherit from those products. Most specific first.\n{% if device_info.arch.bitness == 64 %}\n$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)\n{% endif %}\n$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)\n\n# Inherit from {{ device_info.codename }} device\n$(call inherit-product, device/{{ device_info.manufacturer }}/{{ device_info.codename }}/device.mk)\n\n# Inherit some common Lineage stuff.\n$(call inherit-product, vendor/lineage/config/common_full_phone.mk)\n\nPRODUCT_DEVICE := {{ device_info.codename }}\nPRODUCT_NAME := lineage_{{ device_info.codename }}\n{% if device_info.brand %}\nPRODUCT_BRAND := {{ device_info.brand }}\n{% endif %}\n{% if device_info.model %}\nPRODUCT_MODEL := {{ device_info.model }}\n{% endif %}\nPRODUCT_MANUFACTURER := {{ device_info.manufacturer }}\n\nPRODUCT_GMS_CLIENTID_BASE := {{ device_info.gms_clientid_base }}\n{% if device_info.build_description or device_info.build_fingerprint %}\n\nPRODUCT_BUILD_PROP_OVERRIDES +=\n{%- if device_info.build_description %} \\\n    BuildDesc=\"{{ device_info.build_description }}\"\n{%- endif %}\n{%- if device_info.build_fingerprint %} \\\n    BuildFingerprint={{ device_info.build_fingerprint }}\n{%- endif %}\n\n{% endif %}\n\n"
  },
  {
    "path": "aospdtgen/templates/rootdir_Android.bp.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\n// Init scripts{{ '\\n' }}\n{%- for file in rootdir_bin_files %}\nsh_binary {\n    name: \"{{ file.name }}\",\n    src: \"bin/{{ file.name }}\",\n    vendor: true,\n}\n\n{% endfor %}\n// Init configuration files{{ '\\n' }}\n{%- for file in rootdir_etc_files %}\n{% if not file.name.startswith('fstab.') %}\nprebuilt_etc {\n    name: \"{{ file.name }}\",\n    src: \"etc/{{ file.name }}\",\n    sub_dir: \"init/hw\",\n    vendor: true,\n}\n\n{% endif %}\n{% endfor %}\n// fstab\nprebuilt_etc {\n    name: \"{{ fstab.fstab.name }}\",\n    src: \"etc/{{ fstab.fstab.name }}\",\n    vendor: true,\n}\n\n"
  },
  {
    "path": "aospdtgen/templates/rootdir_Android.mk.jinja2",
    "content": "{% include 'LICENSE.jinja2' %}\n\nLOCAL_PATH := $(call my-dir)\n\n# Recovery init configuration files{{ '\\n' }}\n{%- for file in rootdir_recovery_etc_files %}\ninclude $(CLEAR_VARS)\nLOCAL_MODULE       := {{ file.name }}\nLOCAL_MODULE_TAGS  := optional\nLOCAL_MODULE_CLASS := ETC\nLOCAL_SRC_FILES    := etc/{{ file.name }}\nLOCAL_MODULE_PATH  := $(TARGET_ROOT_OUT)\ninclude $(BUILD_PREBUILT)\n\n{% endfor %}\n\n"
  },
  {
    "path": "aospdtgen/templates/setup-makefiles.py.jinja2",
    "content": "#!./extract-files.py --regenerate_makefiles\n#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\n"
  },
  {
    "path": "aospdtgen/utils/boot_configuration.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nfrom sebaubuntu_libs.libaik import AIKImageInfo, AIKManager\nfrom typing import Optional, Tuple, Union\n\n\nclass BootConfiguration:\n    \"\"\"Class representing a device's boot configuration.\"\"\"\n\n    def __init__(self, dump_path: Path):\n        \"\"\"\n        Given the path to a dump, parse all the images\n        and generate a boot configuration.\n        \"\"\"\n        self.dump_path = dump_path\n\n        self.boot = self._get_image_path(\"boot\")\n        self.dtbo = self._get_image_path(\"dtbo\")\n        self.init_boot = self._get_image_path(\"init_boot\")\n        self.recovery = self._get_image_path(\"recovery\")\n        self.vendor_boot = self._get_image_path(\"vendor_boot\")\n        self.vendor_kernel_boot = self._get_image_path(\"vendor_kernel_boot\")\n\n        assert self.boot, \"No boot image found\"\n\n        self.boot_aik_manager = AIKManager()\n        self.boot_image_info = self.boot_aik_manager.unpackimg(self.boot)\n\n        self.init_boot_aik_manager, self.init_boot_image_info = self._extract_if_exists(\n            self.init_boot\n        )\n\n        self.recovery_aik_manager, self.recovery_image_info = self._extract_if_exists(self.recovery)\n\n        self.vendor_boot_aik_manager, self.vendor_boot_image_info = self._extract_if_exists(\n            self.vendor_boot\n        )\n\n        self.vendor_kernel_boot_aik_manager, self.vendor_kernel_boot_image_info = (\n            self._extract_if_exists(self.vendor_kernel_boot)\n        )\n\n        self.kernel = self.boot_image_info.kernel\n        self.dt = self.boot_image_info.dt\n        self.dtb = self.boot_image_info.dtb\n\n        self.base_address = self.boot_image_info.base_address\n        self.cmdline = self.boot_image_info.cmdline\n        self.pagesize = self.boot_image_info.pagesize\n\n        if self.vendor_boot_image_info:\n            self.kernel = self.vendor_boot_image_info.kernel or self.kernel\n            self.dt = self.vendor_boot_image_info.dt or self.dt\n            self.dtb = self.vendor_boot_image_info.dtb or self.dtb\n            self.dtbo = self.vendor_boot_image_info.dtbo or self.dtbo\n\n            self.base_address = self.vendor_boot_image_info.base_address or self.base_address\n            self.cmdline = self.vendor_boot_image_info.cmdline or self.cmdline\n            self.pagesize = self.vendor_boot_image_info.pagesize or self.pagesize\n\n        if self.init_boot_image_info:\n            self.base_address = self.init_boot_image_info.base_address or self.base_address\n            self.cmdline = self.init_boot_image_info.cmdline or self.cmdline\n            self.pagesize = self.init_boot_image_info.pagesize or self.pagesize\n\n        if self.vendor_kernel_boot_image_info:\n            self.kernel = self.vendor_kernel_boot_image_info.kernel or self.kernel\n            self.dt = self.vendor_kernel_boot_image_info.dt or self.dt\n            self.dtb = self.vendor_kernel_boot_image_info.dtb or self.dtb\n            self.dtbo = self.vendor_kernel_boot_image_info.dtbo or self.dtbo\n\n            self.base_address = self.vendor_kernel_boot_image_info.base_address or self.base_address\n            self.cmdline = self.vendor_kernel_boot_image_info.cmdline or self.cmdline\n            self.pagesize = self.vendor_kernel_boot_image_info.pagesize or self.pagesize\n\n    def _get_image_path(self, partition: str) -> Union[Path, None]:\n        path = self.dump_path / f\"{partition}.img\"\n        return path if path.is_file() else None\n\n    @staticmethod\n    def _extract_if_exists(\n        image: Optional[Path],\n    ) -> Tuple[Optional[AIKManager], Optional[AIKImageInfo]]:\n        if not image:\n            return None, None\n\n        aik_manager = AIKManager()\n        image_info = aik_manager.unpackimg(image, ignore_ramdisk_errors=True)\n\n        return aik_manager, image_info\n\n    def copy_files_to_folder(self, folder: Path) -> None:\n        \"\"\"Copy all prebuilts to a folder.\"\"\"\n        if self.kernel:\n            (folder / \"kernel\").write_bytes(self.kernel.read_bytes())\n\n        if self.dt:\n            (folder / \"dt.img\").write_bytes(self.dt.read_bytes())\n\n        if self.dtb:\n            (folder / \"dtb.img\").write_bytes(self.dtb.read_bytes())\n\n        if self.dtbo:\n            (folder / \"dtbo.img\").write_bytes(self.dtbo.read_bytes())\n\n    def cleanup(self):\n        \"\"\"Cleanup all the temporary files. Do not use this object anymore after calling this.\"\"\"\n        self.boot_aik_manager.cleanup()\n\n        if self.init_boot_aik_manager:\n            self.init_boot_aik_manager.cleanup()\n\n        if self.recovery_aik_manager:\n            self.recovery_aik_manager.cleanup()\n\n        if self.vendor_boot_aik_manager:\n            self.vendor_boot_aik_manager.cleanup()\n\n        if self.vendor_kernel_boot_aik_manager:\n            self.vendor_kernel_boot_aik_manager.cleanup()\n"
  },
  {
    "path": "aospdtgen/utils/format_props.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom pathlib import Path\nfrom sebaubuntu_libs.libandroid.props import BuildProp\nfrom typing import Dict\n\nfrom aospdtgen.proprietary_files.section import sections\nfrom aospdtgen.utils.ignored_props import IGNORED_PROPS\n\n\ndef dump_partition_build_prop(build_prop: BuildProp, destination_file_path: Path):\n    \"\"\"Filter, order and format the build properties and write to file.\"\"\"\n    filtered_build_props = BuildProp()\n    filtered_build_props.import_props(build_prop)\n\n    # Remove ignored properties\n    for ignored_prop in IGNORED_PROPS:\n        filtered_build_props.pop(ignored_prop, None)\n\n    # Don't write the file if there are no properties\n    if not filtered_build_props:\n        return\n\n    section_to_props: Dict[str, BuildProp] = {}\n\n    for section in sections:\n        section_props = BuildProp()\n\n        # Check if the prop belongs to the section\n        for key, value in filtered_build_props.items():\n            if section.property_match(key):\n                section_props.set_prop(key, value)\n\n        # Remove the matched properties from the filtered build props\n        for prop in section_props.keys():\n            filtered_build_props.pop(prop, None)\n\n        if section_props:\n            section_to_props[section.name] = section_props\n\n    # Write the properties to the file\n    with destination_file_path.open(\"w\", encoding=\"utf-8\") as f:\n        for section, props in section_to_props.items():\n            f.write(f\"# {section}\\n\")\n            for prop in sorted(props.keys()):\n                f.write(f\"{prop}={build_prop.get_prop(prop)}\\n\")\n            f.write(\"\\n\")\n"
  },
  {
    "path": "aospdtgen/utils/ignored_props.py",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom sebaubuntu_libs.libandroid.props.utils import get_partition_props\nfrom typing import List\n\nIGNORED_PROPS: List[str] = []\n\"\"\"A list of build props that should be ignored because automatically generated.\"\"\"\n\n# Build info\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.date\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.date.utc\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.description\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.display.id\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.fingerprint\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.flavor\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.host\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.id\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.keys\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.product\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.security_patch\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.tags\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.type\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.user\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.all_codenames\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.base_os\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.codename\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.incremental\", add_empty=True))\nIGNORED_PROPS.extend(\n    get_partition_props(\"ro.{}build.version.min_supported_target_sdk\", add_empty=True)\n)\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.preview_sdk\", add_empty=True))\nIGNORED_PROPS.extend(\n    get_partition_props(\"ro.{}build.version.preview_sdk_fingerprint\", add_empty=True)\n)\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.known_codenames\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.release\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.release_or_codename\", add_empty=True))\nIGNORED_PROPS.extend(\n    get_partition_props(\"ro.{}build.version.release_or_preview_display\", add_empty=True)\n)\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.sdk\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}build.version.security_patch\", add_empty=True))\n\n# Product info\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}brand\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}brand_for_attestation\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}device\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}manufacturer\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}model\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}model_for_attestation\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}name\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.product.{}name_for_attestation\", add_empty=True))\n\n# ABI list\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}product.cpu.abi\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}product.cpu.abilist\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}product.cpu.abilist32\", add_empty=True))\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}product.cpu.abilist64\", add_empty=True))\n\n# Screen density\nIGNORED_PROPS.append(\"ro.sf.lcd_density\")\n\n# Treble/VNDK\nIGNORED_PROPS.extend(get_partition_props(\"ro.{}vndk.version\", add_empty=True))\nIGNORED_PROPS.append(\"ro.treble.enabled\")\nIGNORED_PROPS.append(\"ro.vndk.lite\")\n\n# Bionic\nIGNORED_PROPS.append(\"ro.bionic.arch\")\nIGNORED_PROPS.append(\"ro.bionic.cpu_variant\")\nIGNORED_PROPS.append(\"ro.bionic.2nd_arch\")\nIGNORED_PROPS.append(\"ro.bionic.2nd_cpu_variant\")\n\n# Platform\nIGNORED_PROPS.append(\"ro.board.platform\")\n\n# Partitions\nIGNORED_PROPS.append(\"ro.boot.dynamic_partitions\")\nIGNORED_PROPS.append(\"ro.build.ab_update\")\nIGNORED_PROPS.append(\"ro.build.system_root_image\")\nIGNORED_PROPS.append(\"ro.product.ab_ota_partitions\")\nIGNORED_PROPS.append(\"ro.virtual_ab.enabled\")\n\n# Pixel format\nIGNORED_PROPS.append(\"ro.minui.pixel_format\")\n\n# API levels\nIGNORED_PROPS.append(\"ro.board.api_level\")\nIGNORED_PROPS.append(\"ro.board.first_api_level\")\nIGNORED_PROPS.append(\"ro.product.first_api_level\")\n\n# Zygote\nIGNORED_PROPS.append(\"ro.zygote\")\n\n# Dalvik\nIGNORED_PROPS.append(\"dalvik.vm.isa.arm.features\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.arm.variant\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.arm64.features\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.arm64.variant\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.x86.features\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.x86.variant\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.x86_64.features\")\nIGNORED_PROPS.append(\"dalvik.vm.isa.x86_64.variant\")\nIGNORED_PROPS.append(\"ro.dalvik.vm.enable_uffd_gc\")\n\n# Characteristics\nIGNORED_PROPS.append(\"ro.build.characteristics\")\n\n# Board\nIGNORED_PROPS.append(\"ro.product.board\")\n\n# Locale\nIGNORED_PROPS.append(\"ro.product.locale\")\n\n# APEX\nIGNORED_PROPS.append(\"ro.apex.updatable\")\n\n# Vulkan\nIGNORED_PROPS.append(\"ro.hwui.use_vulkan\")\n\n# ADB\nIGNORED_PROPS.append(\"persist.sys.usb.config\")\nIGNORED_PROPS.append(\"ro.adb.secure\")\nIGNORED_PROPS.append(\"ro.debuggable\")\nIGNORED_PROPS.append(\"ro.force.debuggable\")\nIGNORED_PROPS.append(\"ro.secure\")\n\n# OEM customization\nIGNORED_PROPS.append(\"ro.com.google.clientidbase\")\nIGNORED_PROPS.append(\"setupwizard.theme\")\n"
  },
  {
    "path": "pyproject.toml",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\n[tool.poetry]\nname = \"aospdtgen\"\nversion = \"1.2.1\"\ndescription = \"Create an Android device tree from a device dump\"\nauthors = [\"Sebastiano Barezzi <seba@sebaubuntu.dev>\"]\nlicense = \"Apache-2.0\"\nreadme = \"README.md\"\nrepository = \"https://github.com/sebaubuntu-python/aospdtgen\"\n\n[tool.poetry.scripts]\naospdtgen = 'aospdtgen.main:main'\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\nJinja2 = \"^3.1.6\"\nGitPython = \"^3.1.45\"\nsebaubuntu-libs = \"^2.0.0\"\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n"
  },
  {
    "path": "ruff.toml",
    "content": "#\n# SPDX-FileCopyrightText: The LineageOS Project\n# SPDX-License-Identifier: Apache-2.0\n#\n\nline-length = 100\n\n[format]\ndocstring-code-format = true\n"
  }
]