Fix pyproject installer

This commit is contained in:
Bjoern Kerler 2024-08-24 14:24:17 +02:00
parent 5a3b9399a9
commit 168aa1d464
No known key found for this signature in database
GPG key ID: A3E0FAF79F2F4578
4 changed files with 36 additions and 39 deletions

View file

@ -1,8 +0,0 @@
include README.md
include LICENSE
include mtkclient/Loader/*.bin
include mtkclient/Loader/Preloader/*.bin
include mtkclient/payloads/*.bin
include mtkclient/Windows/*.dll
include mtkclient/gui/images/*.png

10
mtk.py
View file

@ -40,7 +40,8 @@ cmds = {
"script": "Run multiple commands using text script",
}
if __name__ == '__main__':
def main():
print(info)
print("")
parser = argparse.ArgumentParser(description=info)
@ -101,7 +102,8 @@ if __name__ == '__main__':
da_vbmeta = da_cmds.add_parser("vbmeta", help="Patch vbmeta partition")
da_vbmeta.add_argument('--preloader', help='Set the preloader filename for dram config')
da_vbmeta.add_argument("vbmode", type=str, help="vbmeta mode (0=locked, 1=disable_verity, 2=disable_verification, 3=disable verity+verification)")
da_vbmeta.add_argument("vbmode", type=str,
help="vbmeta mode (0=locked, 1=disable_verity, 2=disable_verification, 3=disable verity+verification)")
da_rpmb = da_cmds.add_parser("rpmb", help="RPMB Tools")
@ -1008,3 +1010,7 @@ if __name__ == '__main__':
exit(0)
mtk = Main(args).run(parser)
if __name__ == '__main__':
main()

View file

@ -501,7 +501,7 @@ class MainWindow(QMainWindow):
self.ui.spinner_pic.setHidden(True)
if __name__ == '__main__':
def main():
# Enable nice 4K Scaling
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
@ -551,3 +551,7 @@ if __name__ == '__main__':
# Prevent thread from not being closed and call error end codes
thread.terminate()
thread.wait()
if __name__ == '__main__':
main()

View file

@ -1,9 +1,6 @@
[build-system]
requires = [
"setuptools>=61",
"wheel",
]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "mtkclient"
@ -39,31 +36,29 @@ Repository = "https://github.com/bkerler/mtkclient.git"
Issues = "https://github.com/bkerler/mtkclient/issues"
[project.scripts]
mtk = "mtk:main"
stage2 = "stage2:main"
da_parser = "Tools.da_parser:main"
brom_to_offs = "Tools.brom_to_offs:main"
mtk = "mtkclient.mtk:main"
stage2 = "mtkclient.stage2:main"
da_parser = "mtkclient.Tools.da_parser:main"
brom_to_offs = "mtkclient.Tools.brom_to_offs:main"
[project.gui-scripts]
mtk_gui = "mtkclient.mtk_gui:main"
[tool.setuptools]
# See also the MANIFEST.in file.
packages = [
"mtkclient.config",
"mtkclient.Library",
"mtkclient.Library.Connection",
"mtkclient.Library.DA",
"mtkclient.Library.DA.legacy",
"mtkclient.Library.DA.legacy.extension",
"mtkclient.Library.DA.xflash",
"mtkclient.Library.DA.xflash.extension",
"mtkclient.Library.DA.xml",
"mtkclient.Library.DA.xml.extension",
"mtkclient.Library.Exploit",
"mtkclient.Library.Filesystem",
"mtkclient.Library.Hardware",
"Tools"
[tool.hatch.build.targets.sdist]
include = [
"mtkclient/Loader/*.bin",
"mtkclient/Loader/Preloader/*.bin",
"mtkclient/payloads/*.bin",
"mtkclient/Windows/*.dll",
"mtkclient/gui/images/*.png",
"Tools/*.py"
]
# We want to install all the files in the package directories...
include-package-data = true
[tool.hatch.build.targets.wheel.force-include]
"Tools/brom_to_offs.py" = "mtkclient/Tools/brom_to_offs.py"
"Tools/da_parser.py" = "mtkclient/Tools/da_parser.py"
"mtk.py" = "mtkclient/mtk.py"
"mtk_gui.py" = "mtkclient/mtk_gui.py"
"stage2.py" = "mtkclient/stage2.py"
"LICENSE" = "LICENSE"
"README.md" = "README.md"