Closed muzamilw closed 4 years ago
How about using pack
command directly? For example,
pyarmor pack -x " --advanced 2" -e " --onefile --windowed --icon=ml.icns --runtime-tmpdir /var/user/" main.py
How about using
pack
command directly? For example,pyarmor pack -x " --advanced 2" -e " --onefile --windowed --icon=ml.icns --runtime-tmpdir /var/user/" main.py
Actually I have a customized spec file as below, not sure if this can be achieved using pack command.
import os from os.path import join from kivy.tools.packaging import pyinstaller_hooks as hooks from kivy import kivy_data_dir from kivymd import hooks_path as kivymd_hooks_path
spec_root = os.path.abspath(SPECPATH) block_cipher = None app_name='appname' mac_icon = 'ml.icns'
kivy_deps_all = hooks.get_deps_all() kivy_factory_modules = hooks.get_factory_modules() hiddenimports = kivy_deps_all['hiddenimports'] + kivy_factory_modules + ['pkg_resources.py2_warn'] + ['backend_kivy'] + ["requests"] + ["numpy"] + ["pandas"] + ["email.mime"] + ["email.mime.multipart"] + ["email.mime.text"] + ["instagram_private_api"] + ["kivymd"] + ["kivymd.app"] + ["kivymd.uix.button"] + ["schedule"]+ ["kivy.garden"] + ["matplotlib"] + ["customFunctions"] + ["apiWrappers"] + ["botLogic"] + ["ready"] + ["home"] + ["kivy.garden.matplotlib.backend_kivyagg"] + ["progressbar"] + ["iglogin"] + ["login"]
kivy_assets_toc = Tree(kivy_data_dir, prefix=join('kivy_install', 'data')) source_assets_toc = Tree('data', prefix='data')
assets_toc = [kivy_assets_toc, source_assets_toc]
tocs = assets_toc #+ bin_tocs
a = Analysis(['main.py'], pathex=[spec_root], binaries=[], datas=[('*.kv','.')], hiddenimports=hiddenimports, hookspath=[kivymd_hooks_path], runtime_hooks=[], excludes=[ 'Tkinter', 'enchant', 'twisted','pygments'], #'_tkinter', win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False) a.binaries = a.binaries - TOC([('libpng16.16.dylib',None,None)])
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='start', debug=True, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True )
coll = COLLECT(exe,Tree('/Users/JanatFarooq/Documents/appfolder/'), a.binaries, a.zipfiles, a.datas, *tocs, strip=False, upx=True, name=app_name)
app = BUNDLE(exe, name=app_name + '.app', icon=mac_icon, bundle_identifier='com.user.coname.appname')
The pack
command should support this customized spec file, try this command
pyarmor pack -x " --advanced 2" -s main.spec main.py
Hi All,
I've successfully obfuscated the code for Windows and created the custom package using pyinstaller. I had to change my spec file to add the missing hidden imports.
howoever doing the same process on MacOSx is showing me the following error ( I am using super mode 2 ) If I run the scripts directly it works but pyinstaller isn't working ( it is working without obfuscating the scripts )
following is the myinstaller command. pyinstaller mac2.spec --onefile --windowed --icon=ml.icns -y --runtime-tmpdir /var/user/
[41608] LOADER: Running main.py [41607] LOADER: Restoring signal handlers [41607] LOADER: freeing args [41607] LOADER: re-raising child signal 11 Segmentation fault: 11 logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.
[Process completed]
any help would be appreciated to diagnose the issue.