Skip to content

Commit

Permalink
- When patching with APatch, handle devices that don't have init_boot.
Browse files Browse the repository at this point in the history
  • Loading branch information
badabing2005 committed Mar 28, 2024
1 parent 4810f52 commit 808fca5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 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-dark-256.icns')
app = BUNDLE(exe,
name='PixelFlasher.app',
version='6.9.0.1',
version='6.9.0.2',
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.9.0.1
VERSION=6.9.0.2
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 = '6.9.0.1'
VERSION = '6.9.0.2'
SDKVERSION = '33.0.3'
MAIN_WIDTH = 1400
MAIN_HEIGHT = 1040
Expand Down
11 changes: 6 additions & 5 deletions modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2025,10 +2025,11 @@ def patch_apatch_script(patch_method="app"):
data += "chmod 755 *\n"
data += "PATCHING_APATCH_VERSION=$(/data/local/tmp/pf/assets/apd -V)\n"
data += "echo \"PATCHING_APATCH_VERSION: $PATCHING_APATCH_VERSION\"\n"
data += "echo \"Extracting ramdisk from init_boot ...\"\n"
data += f"cp {self.config.phone_path}/{init_boot_img} ./init_boot.img\n"
# unpack ramdisk.cpio from init_boot.img first and place it in the assets folder
data += "./magiskboot unpack init_boot.img\n"
if init_boot_path is not None:
# unpack ramdisk.cpio from init_boot.img first and place it in the assets folder
data += "echo \"Extracting ramdisk from init_boot ...\"\n"
data += f"cp {self.config.phone_path}/{init_boot_img} ./init_boot.img\n"
data += "./magiskboot unpack init_boot.img\n"

data += "echo \"Creating a patch ...\"\n"
data += f"./boot_patch.sh {superkey} {self.config.phone_path}/{boot_img} -K kpatch\n"
Expand Down Expand Up @@ -2320,7 +2321,7 @@ def patch_apatch_script(patch_method="app"):
puml("#red:Failed to transfer the boot file to the phone;\n")
print("Aborting ...\n}\n")
return
if patch_flavor == 'APatch':
if patch_flavor == 'APatch' and init_boot_path is not None:
# transfer init_boot.img to the phone as the RAMDISK is in the init_boot.img and is needed for patching
res = device.push_file(f"{init_boot_path}", f"{self.config.phone_path}/{init_boot_img}")
if res != 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: 6.9.0.1
Version: 6.9.0.2
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=(6,9,0,1),
prodvers=(6,9,0,1),
filevers=(6,9,0,2),
prodvers=(6,9,0,2),
# 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'6.9.0.1'),
StringStruct(u'FileVersion', u'6.9.0.2'),
StringStruct(u'InternalName', u'PixelFlasher'),
StringStruct(u'LegalCopyright', u''),
StringStruct(u'OriginalFilename', u'PixelFlasher.exe'),
StringStruct(u'ProductName', u'PixelFlasher'),
StringStruct(u'ProductVersion', u'6.9.0.1')])
StringStruct(u'ProductVersion', u'6.9.0.2')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down

0 comments on commit 808fca5

Please sign in to comment.