Skip to content

Commit

Permalink
- When patching with KernelSu on devices that have init_boot partitio…
Browse files Browse the repository at this point in the history
…n, patch boot partition, not init_boot.

- Added Dev Tools | keybox.xml validity checker (credit to @hldr4)
- `Extra Img Extraction` setting now additionally extracts `dtbo`, `vendor_boot`, `vendor_kernel_boot`, `super_empty` (useful for some ROMs).
- When custom patching, `Paste` button will automatically paste the path to the (extra) image type selected.
- Improved logging.
  • Loading branch information
badabing2005 committed Mar 20, 2024
1 parent db20e53 commit 3a486da
Show file tree
Hide file tree
Showing 22 changed files with 585 additions and 514 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
227 changes: 140 additions & 87 deletions Main.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ The following details are listed.
- **SHA1** is (shortened for display only) sha1 of `boot.img` (or `init_boot.img` for Pixel 7 or newer devices)
- **Source SHA1** (shortened for display only) SHA1 of source `boot.img` extracted from the image (This should be the same as SHA1 of an unpatched `boot.img`)
- **Package Fingerprint** is just the filename portion of the image (without the extension).
- **Patched with Magisk** indicates the version of Magisk used to patch the image (if applicable).
- **Patched with Version** indicates the version of Magisk / KernelSU / Apatch used to patch the image (if applicable).
- **Patched Method** indicates what method PixelFlasher used to create a patch (possible options: `root`, `app`, `uiautomator`, `manual`)
- **Patched on Device** indicates the device model that performed the patching. You should always use patched images that match the model of the device that it will be flashed on.
- **Date** is the either the date the `boot.img` was extracted, or the date it was patched.
Expand Down
2 changes: 1 addition & 1 deletion advanced_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _open_scrcpy_link(self, event):
webbrowser.open_new(SCRCPYURL)
puml(f":Open scrcpy Link;\nnote right\n=== scrcpy\n[[{SCRCPYURL}]]\nend note\n", True)
except Exception as e:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while opening skd link")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Encountered an error while opening skd link")
traceback.print_exc()

def _onResetMagiskPkg(self, e):
Expand Down
4 changes: 2 additions & 2 deletions backup_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, *args, **kwargs):
self.all_cb_clicked = False
self.device = get_phone()
if not self.device:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: You must first select a valid device.")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: You must first select a valid device.")
return -1

self.sha1 = self.device.magisk_sha1
Expand Down Expand Up @@ -454,7 +454,7 @@ def OnAutoBackup(self, e):
self._on_spin('stop')
return
else:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: The dumped partition does not contain source boot's SHA1")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: The dumped partition does not contain source boot's SHA1")
print("This is normal for older devices, but newer deviced should have it.")
print("Cannot create automatic backup file, you can still manually select and create one.")
print("Aborting ...")
Expand Down
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-dark-256.icns')
app = BUNDLE(exe,
name='PixelFlasher.app',
version='6.8.3.0',
version='6.8.4.0',
icon='./images/icon-dark-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=6.8.3.0
VERSION=6.8.4.0
NAME="PixelFlasher"
DIST_NAME="PixelFlasher"

Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def load(cls, file_path):
conf.first_run = True
conf.first_run_date = f"{datetime.now():%Y-%m-%d %H:%M:%S}"
except Exception as e:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: encountered an exception during configuartion file loading.")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: encountered an exception during configuartion file loading.")
print(f"Exception: {e}")
print("Deleting the configuration file to recover ...")
os.remove(file_path)
Expand Down
3 changes: 2 additions & 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 = '6.8.3.0'
VERSION = '6.8.4.0'
SDKVERSION = '33.0.3'
MAIN_WIDTH = 1400
MAIN_HEIGHT = 1040
Expand Down Expand Up @@ -41,6 +41,7 @@
'-ElementalX',
'-Elite',
'-franco',
'-hadesKernel',
'-Lineage-',
'-lineage-',
'-LineageOS',
Expand Down
1 change: 1 addition & 0 deletions encode-bitmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"-a -F -i -n save-24 images/save-24.png images.py",
"-a -F -i -n kernelsu-24 images/kernelsu-24.png images.py",
"-a -F -i -n apatch-24 images/apatch-24.png images.py",
"-a -F -i -n cert-24 images/cert-24.png images.py",
]

if __name__ == "__main__":
Expand Down
10 changes: 10 additions & 0 deletions images.py
Original file line number Diff line number Diff line change
Expand Up @@ -6515,3 +6515,13 @@
b'ahIogQqCASNzc0trW3tHTGcXWoR0S9X1VNb2Wgj2QQVgoJ9ZJW3CxLSQSf1QATjol5g8Zeo0'
b'ielQLhLoB1pagqEeHTAwAAAEn0WcBB+K8QAAAABJRU5ErkJggg==')

#----------------------------------------------------------------------
cert_24 = PyEmbeddedImage(
b'iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABFklEQVRIS9WUzRGCMBCFd8UC'
b'bEBGOsAO8CacLAUqcKwAOlAr0BN6kxLsAIY+MGYPwZARiPw4ygkIvC9v920QRr5wZH34HsAL'
b'Uxtwugdgdh9XDCBhrNhdAyshndKBG+U3/uD0EZf+zWLftCoAL8o5HIAv9CqbqlOKyQviXnWj'
b'Ax8EwEVOD1YEfAMLRGN78c2V2IwWoK0PqkPZmRagTmAdpg7t+E0YzuSIJyfrBXDDfIMIIZVG'
b'dilHUwvw9RIJoKg1zQwNE4IxI0ci8/SdloPRYzpWiVK1eXWDVpey13u8x/58WTkqKIITNPhh'
b'V02IDBE9aAJQopDBMQ7MQwXQVhZ5vWnQVJ1OB9v/A5rmYJASfdKvTj34KcATT0TYGZdaUUAA'
b'AAAASUVORK5CYII=')

Binary file added images/cert-24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions magisk_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def onInstallPif(self, e):
device.install_magisk_module(downloaded_file_path)
self.refresh_modules()
except Exception as e:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Play Integrity Fix module installation.")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Play Integrity Fix module installation.")
traceback.print_exc()
self._on_spin('stop')

Expand Down Expand Up @@ -511,10 +511,10 @@ def onUninstallModule(self, e):
modules[i].state = 'remove'
self.refresh_modules()
else:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to remove module: {modules[i].name}")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to remove module: {modules[i].name}")
break
except Exception as e:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Magisk modules uninstall")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Magisk modules uninstall")
traceback.print_exc()
self._on_spin('stop')

Expand All @@ -537,7 +537,7 @@ def onUpdateModule(self, e):
device.install_magisk_module(downloaded_file_path)
self.refresh_modules()
except Exception as e:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Magisk modules update")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Exception during Magisk modules update")
traceback.print_exc()
self._on_spin('stop')

Expand Down Expand Up @@ -614,14 +614,14 @@ def onOk(self, e):
if res == 0:
modules[i].state = 'enabled'
else:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to disable module: {modules[i].name}")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to disable module: {modules[i].name}")
else:
print(f"Module: {modules[i].name:<36} state has changed, DISABLING the module ...")
res = device.disable_magisk_module(modules[i].dirname)
if res == 0:
modules[i].state = 'disbled'
else:
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to disable module: {modules[i].name}")
print(f"\n{datetime.now():%Y-%m-%d %H:%M:%S} ERROR: Failed to disable module: {modules[i].name}")
print('')
self.EndModal(wx.ID_OK)

Expand Down
Loading

0 comments on commit 3a486da

Please sign in to comment.