Skip to content

Commit

Permalink
Improved debug messages for troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
badabing2005 committed Oct 6, 2023
1 parent 3ffc0df commit 186d81f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build-on-mac.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ exe = EXE(pyz,
icon='images/icon-256.icns')
app = BUNDLE(exe,
name='PixelFlasher.app',
version='5.8.0.2',
version='5.8.0.3',
icon='./images/icon-256.icns',
bundle_identifier='com.badabing.pixelflasher')
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
rm -rf build dist
VERSION=5.8.0.2
VERSION=5.8.0.3
NAME="PixelFlasher"
DIST_NAME="PixelFlasher"

Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

APPNAME = 'PixelFlasher'
CONFIG_FILE_NAME = 'PixelFlasher.json'
VERSION = '5.8.0.2'
VERSION = '5.8.0.3'
SDKVERSION = '33.0.3'
WIDTH = 1400
HEIGHT = 1040
Expand Down
6 changes: 5 additions & 1 deletion modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,18 +1775,22 @@ def patch_script(patch_method):
data += "fi\n"

data += "SYSTEM_ROOT=false\n"
data += "SYSTEM_AS_ROOT=false\n"
data += "grep \' / \' /proc/mounts | grep -qv \'rootfs\' && SYSTEM_ROOT=true\n"
data += "grep \' / \' /proc/mounts | grep -qv \'rootfs\' && SYSTEM_AS_ROOT=true\n"
data += ". ./util_functions.sh\n"
data += 'get_flags\n'
data += "echo -------------------------\n"
data += "echo \"SYSTEM_ROOT: $SYSTEM_ROOT\"\n"
data += "echo \"SYSTEM_AS_ROOT: $SYSTEM_AS_ROOT\"\n"
data += "echo \"KEEPVERITY: $KEEPVERITY\"\n"
data += "echo \"KEEPFORCEENCRYPT: $KEEPFORCEENCRYPT\"\n"
data += "echo \"RECOVERYMODE: $RECOVERYMODE\"\n"
data += "echo \"PATCHVBMETAFLAG: $PATCHVBMETAFLAG\"\n"
data += "echo \"ISENCRYPTED: $ISENCRYPTED\"\n"
data += "echo \"VBMETAEXIST: $VBMETAEXIST\"\n"
data += "export KEEPVERITY KEEPFORCEENCRYPT RECOVERYMODE PATCHVBMETAFLAG ISENCRYPTED VBMETAEXIST SYSTEM_ROOT\n"
data += "echo \"LEGACYSAR: $LEGACYSAR\"\n"
data += "export KEEPVERITY KEEPFORCEENCRYPT RECOVERYMODE PATCHVBMETAFLAG ISENCRYPTED VBMETAEXIST SYSTEM_ROOT SYSTEM_AS_ROOT LEGACYSAR\n"
data += "echo -------------------------\n"
data += "echo \"Creating a patch ...\"\n"
data += "./magiskboot cleanup\n"
Expand Down
16 changes: 7 additions & 9 deletions phone.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def get_package_details(self, package):
return '', ''
except Exception as e:
print(e)
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list.")
puml("#red:ERROR: Could not get package list;\n", True)
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get_package_details.")
puml("#red:ERROR: Could not get_package_details;\n", True)
return '', ''

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -1431,9 +1431,7 @@ def get_package_path(self, pkg: str, check_details = True) -> str:
print(f"Package Path is: {pkg_path}")
return pkg_path
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package {pkg} path.")
print(f"Return Code: {res.returncode}.")
print(f"Stdout: {res.stdout}")
print(f"Stderr: {res.stderr}")
print(f"{details}")
return -1
except Exception as e:
print(e)
Expand Down Expand Up @@ -2348,14 +2346,14 @@ def get_package_list(self, state = ''):
res = run_shell(theCmd)
if res.returncode == 0:
return res.stdout.replace('package:','')
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list.")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list of {state}.")
print(f"Return Code: {res.returncode}.")
print(f"Stdout: {res.stdout}.")
print(f"Stderr: {res.stderr}.")
return None
except Exception as e:
print(e)
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list.")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list of {state}.")
return None


Expand Down Expand Up @@ -2426,8 +2424,8 @@ def get_detailed_packages(self):

except Exception as e:
print(e)
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get package list.")
puml("#red:ERROR: Could not get package list;\n", True)
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Could not get detailed packages.")
puml("#red:ERROR: Could not get detailed packages;\n", True)
return -1
return 0

Expand Down
2 changes: 1 addition & 1 deletion windows-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://github.com/DudeNr33/pyinstaller-versionfile
# create-version-file windows-metadata.yaml --outfile windows-version-info.txt
Version: 5.8.0.2
Version: 5.8.0.3
FileDescription: PixelFlasher
InternalName: PixelFlasher
OriginalFilename: PixelFlasher.exe
Expand Down
8 changes: 4 additions & 4 deletions windows-version-info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0. Must always contain 4 elements.
filevers=(5,8,0,2),
prodvers=(5,8,0,2),
filevers=(5,8,0,3),
prodvers=(5,8,0,3),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -32,12 +32,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u''),
StringStruct(u'FileDescription', u'PixelFlasher'),
StringStruct(u'FileVersion', u'5.8.0.2'),
StringStruct(u'FileVersion', u'5.8.0.3'),
StringStruct(u'InternalName', u'PixelFlasher'),
StringStruct(u'LegalCopyright', u''),
StringStruct(u'OriginalFilename', u'PixelFlasher.exe'),
StringStruct(u'ProductName', u'PixelFlasher'),
StringStruct(u'ProductVersion', u'5.8.0.2')])
StringStruct(u'ProductVersion', u'5.8.0.3')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down

0 comments on commit 186d81f

Please sign in to comment.