[Miscellaneous Android Development] badabing2003:
View attachment 5709049​

DESCRIPTION​

As the name suggests this is an application to flash (update) Pixel™ phones (possibly all Google™ made phones/tablets, YMMV.)

PixelFlasher at its core is a UI layer (with bells and whistles) on top of adb / fastboot commands, hence many of its features can be used on non Pixel devices as well. (YMMV).

The executable is self contained and does not require Python™ to be installed on the system.

Basic mode: Should suit most users. Some of the features in basic mode are:

Simple UI interface, click and go. No more command line, no more placing all files in one directory.

boot.img / init_boot.img management UI, select the boot / init_boot file to patch and click the patch button. Fully Automated patching with Magisk (without manual steps) and perform upgrades without losing root.

No more manually extracting files transferring to the phone, patching / re-flashing and doing multiple reboots.

No more setting airplane mode and clearing storage to retain Safetynet / Play Integrity passing.

Display details of boot.img (or init_boot.img for Pixel 7 or newer devices).

SHA1 checksum.

Origin (file it was extracted from).

Whether it is patched or not, and if it is patched.

What version of Magisk was used to patch it.

On what device it was patched.

Date of patching.

The SHA1 of the source boot.img file.

Option to Live boot from a choice of boot.img or patched image.

Flash just the boot / init_boot image.

Choose to keep data or wipe data while flashing (Full OTA flashing always keeps data).

Ability to flash even if multiple devices are connected to the computer.

Option to flash to inactive slot (Full OTA always flashes to inactive slot).

Display information about the phone.

ID

Hardware model.

Device architecture.

Current installed firmware (build).

If it is rooted with Magisk.

Magisk version (Magisk Tools).

Magisk Manager version (the app).

List installed Magisk modules.

Connection mode (Adb | Fastboot | Sideload | Recovery).

Bootloader version.

Active slot.

Android OS API version.

Convenient quick links to download Android platform tools or device firmware.

Magisk Manager installation UI, screenshot. Supported versions:

stable (official)

beta (official)

canary (official)

debug (official)

alpha

delta

special build that disables modules, used to recover from bootloops due to bad module(s) when safe mode does not work.

Magisk Backup Manager, screenshot.

List all Magisk backups currently on the device.

Highlight the one that is backup of the current installed version.

Delete backups.

Manually add backup from PC.

Auto Backup: PixelFlasher figures out what needs to be backed up, and if it finds it on the PC, it creates the backup.

Magisk modules management, enable / disable modules selectively, this comes in handy to disable suspect modules before an upgrade screenshot:

Name

Version

Description

Enabled / Disabled.

Display Android Platform Tools (SDK) version and warn / block if the version is old.

Install APK (an app) file from the computer onto the device.

Wireless Manager, to wirelessly connect to adb debug or adb wireless with pairing support.

Advanced features are hidden to keep the interface simple and easy to follow.

Easily open ADB shell to the device.

Support for Genymotion Scrcpy to mirror Android devices (video and audio) via USB or over TCP/IP, and allows to control the device with the keyboard and the mouse of the computer.

A lot of checks and validations for smooth operation with quite verbose console output to inform about every step of the operation.

Automatic check for program updates.

Package (Application) Manager, screenshot:

Disable (Freeze)

Enable

Uninstall

Install APK

Download APK

Multi-Select

Show Package Details.

Add app to Magisk denylist.

Expert mode: (should only be turned on by experienced users). In addition to the basic features, you get:

The ability to flash custom ROM (with or without patching boot / init_boot)

Option to flash to both slots.

Option to flash to inactive slot.

Options to disable verity and or verification.

Ability to change the active slot.

Ability to live boot to custom boot / init_boot (temporary root).

Ability to boot to recovery, fastbootd, safe mode, download mode and sideload.

Ability to flash custom image: boot, recovery, radio, kernel, ...

Ability to sideload an image.

Lock / Unlock bootloader.

Option to gain temporary root (good for testing or checking things out).

SOS Disable Magisk modules to get out of bootloop.

Force option when flashing.

Option to skip rebooting.

Option to wipe.

Partition Manager:

Erase single or multi partitions.

Dump / create backup of single or multi partitions and save to PC.

Prerequisites​

Android SDK Platform-Tools.

Android Pixel phone factory image or Android Pixel phone full OTA image.

Bootloader unlocked phone (see excellent guide links in credits section below).

Installation​

PixelFlasher doesn't have to be installed, just double-click it and it'll start.

Check the releases section for downloads.

Supported platforms​

Windows

MacOSX

Linux

​

Usage​

Basic Mode

First thing to do is select Android™ Platform Tools, if Android™ Platform Tools is already in your PATH environment, the application will detect it and pre-populate it.

Otherwise you'd have to select where it is installed.

You can download the lastest Android™ Platform Tools by clicking the next to it.

If you have multiple versions, you can select another version, although it is best to always use the most recent version (The selected version will be identified and displayed).

Hit the Scan button to detect connected devices, the application will detect all connected devices.

(in adb, fastboot, sideload, recovery modes) and populate the combo box (2).

Select your device from the list in the combo box. The following information about the connected device is displayed.

(1st field) Rooted devices will be identified with a checkmark ✓. Note: If you want PixelFlasher to detect root, or automatically use Magisk to patch boot.img, you need to grant root permissions to shell in Magisk.

(1st field) Non-Rooted devices will be identified with a ✗.

(1st field) Devices in fastboot mode will be identified with a ? (in fastboot mode, root status cannot be determined).

(2nd field) (adb), (f.b), (sid) or (rec) to indicate connection mode adb / fastboot / sideload / recovery.

(3rd field) Device ID.

(4th field) Device hardware.

(5th field) Current running firmware (in fastboot mode current firmware cannot be determined).

Next select the full OTA (recommended) or factory zip file (don't unzip), the application will recognize the phone model from the image name and validate the SHA-256 checksum.

You can download full OTA images from here or clicking the right next to it. You can also download factory images by clicking the left next to it.

Note: Because both firmware package and full OTA are complete images, you can upgrade to any newer version without worrying about jumping versions (downgrades with factory image are possible only with wipe data).

Process the full OTA or factory image. PixelFlasher will extract boot.img (or init_boot.img for Pixel 7 or newer devices) file from the image and populate it in the list below (5).

Select boot.img (or init_boot.img for Pixel 7 or newer devices) from the list, the selected file can be patched in adb mode (6), or flashed in bootloader mode (10).

Optional: Select this option if you want to patch the boot.img (or init_boot.img for Pixel 7 or newer devices) with Magisk. If Magisk is not already installed on your phone, PixelFlasher will install it for you. Your phone does not need to be rooted to create a patched file. This would be the typical choice for monthly updates.

This option will allow updating the phone without losing root (not even temporarily).

Note: See note above for granting root permissions to shell.

Whether the phone is rooted or not, the whole process is without any manual step.

If you want to flash (10) a patched boot.img (or init_boot.img for Pixel 7 or newer devices) select the newly added entry.

The following details are listed.

Indicates that the selection is patched.

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 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.

Package Path indicates the file from which boot.img (or init_boot.img for Pixel 7 or newer devices) was extracted.

Select the Flash Mode, PixelFalsher will automatically select applicable flash mode based on the selected image type.

If full OTA imageis selected (recommended) in step 4:

Full OTA: Will flash full OTA image in sideload mode. Features of this mode:

This will always flash to inactive slot only, (hence why the option to flash to both slots is disabled) similar to how OTA updates happen on the phone.

It will always be Keep Data, there is no option for Wipe, hence why the option is disabled.

If something goes wrong during flashing, the active slot is unaffected and the phone boots back to active functional slot.

If you want to flash to both slots (ie flash twice in a row) then both slots would be bootable.

Your phone's bootloader does not have to be unlocked to be able to flash full OTA image (stock boot only).

You cannot downgrade with OTA, the version being installed has to be equal or higher.

If Factory image is selected in step 4:

Keep Data: In this mode -w flag is removed from the flash scripts so that data is not wiped. This is commonly known as dirty flashing.

WIPE all data: As the text suggests, this will wipe your data, use it with caution!

If this mode is selected PixelFlasher will ask for confirmation during the flashing phase.

Dry Run: In this mode, the phone will reboot to bootloader, and then mimic the flash actions (i.e. reboot into bootloader) without actually flashing anything (it prints to the console the steps it would have performed if dry run was not chosen).

This is handy for testing to check if the PixelFlasher properly is able to control fastboot commands.

Optional: Open Magisk Modules Manager and disable (uncheck) modules known to cause issues during upgrades (highly recommended). (The list below has never caused issues for me, so I keep them enabled YMMV).

Flash Pixel Phone This is the final step, to actually flash the phone in the selected Flash Mode.

Note: Unlike the previous versions of the PixelFlasher, all the options are dynamic, i.e. depending on what you select before clicking the Flash button, there is no more concept of prepared package. PixelFlasher will first present you the selected options and ask for your confirmation if you want to proceed with flashing.

Monitor the console output and observe the performed actions and their outcomes.

In case of trouble, click on **Support** button to generate santized (redacted) support logs archive.

Expert Mode

To enable the export mode use the File Menu | Advanced Configuration and select Enable Advanced Options

In this mode the following additional options are exposed (green bounding boxes), below notes are more for enumeration than a guide, as they should be trivial and obvious to an expert.

Option to Change the Active Slot (the inactive slot is automatically selected).

Option to reboot to Recovery.

Options to Lock / Unlock bootloader, Option to disable Magisk modules when bootlooping.

Apply Custom ROM. This replaces the factory ROM image with the selected file.

PixelFlasher extracts boot.img from the ROM image and displays below for selection or patching. Please make sure to read the documentation of the chosen ROM, as each custom ROM instructions could be different.

To be clear, this is what PixelFlasher does internally when this mode is selected, please understand it, and don't use it if the selected ROM guide does not fit the bill. You've been warned!

Keeps stock bootloader and radio images.

Replaces the stock ROM image with the selected custom ROM image.

Flashes in the chosen Flash Mode just like a stock image, i.e. bootloader, custom ROM and radio images in the original order that they were in the stock firmware.

Patching boot.img can be performed if the option is selected. You can select any of the listed boot.img.

Flash Mode is similar to basic flash mode described above in step 7.

Custom Flash. select this to switch from flashing a Factory Image to flashing a single file.

Browse to select a a valid image file (.img or .zip). Or select a boot.img from the list above and click on the paste button to paste the selected boot.img into the file selection. Choose the dropdown to select image type.

boot (can be flashed to Live or boot) - Expected file type .img

bootloader - Expected file type .img

dtbo - Expected file type .img

product - Expected file type .img

radio - Expected file type .img

recovery - Expected file type .img

super_empty - Expected file type .img

system - Expected file type .img

system_ext - Expected file type .img

system_other - Expected file type .img

vbmeta - Expected file type .img

vbmeta_system - Expected file type .img

vbmeta_vendor - Expected file type .img

vendor - Expected file type .img

vendor_boot - Expected file type .img

vendor_dlkm (the device will be put into fastbootd mode during this operation) - Expected file type .img

image - Expected file type .zip

SIDELOAD - Expected file type .zip

Select the appropriate flash options. Note: For Tensor devices (Pixel 6 or newer devices) When Flash to both slots option is selected, Pixelflasher flashes each slot individually to overcome a Google bug that fails with the option --slot=all

Credits​

First and foremost Magisk by John Wu which made rooting Pixel™ phones possible, without it none of this would have mattered.

Big thanks to [ryder203], [t-ryder] for his valuable ideas, feedback and testing. Your contributions are very much appreciated.

[Homeboy76], [v0latyle] and [roirraW-edor-ehT] at xda for their excellent guides [here, here and here] on Pixel™ series phones. This program could not have been possible without their easy to follow guides.

I strongly encourage all beginners to follow those guides rather than use this program, it is important to understand the basic steps involved before diving into one click tools or advanced tasks.

Marcel Stör's nodemcu-pyflasher source code which jump started my introduction to wxPython and eventually this program.

JackMcKew for pyinstaller Github Actions.

Endless counts of xda members and their posts that tirelessly answer questions and share tools. Too many to enumerate.

Disclaimer​

*******************************************************************************
PLEASE DO YOUR PART AND READ / SEARCH / RESEARCH BEFORE USING THIS PROGRAM
AND/OR ATTEMPTING ANY MODIFICATIONS ON YOUR DEVICE.
THIS PROGRAM ASSUMES THAT YOU ALREADY KNOW HOW TO AND HAVE ALREADY UNLOCKED
YOUR BOOTLOADER, ALREADY ROOTED YOUR DEVICE, AND KNOW HOW TO USE ANDROID SDK
PLATFORM-TOOLS, ETC.
THIS TOOL IS SIMPLY MY QUICK WAY OF UPDATING THE FIRMWARE WHILE ROOTED WITH
MAGISK, WITHOUT LOSING DATA / REQUIRING A WIPE.
MODIFYING YOUR DEVICE COMES WITH INHERENT RISKS, AND IT'S NOT MY RESPONSIBILITY
IF YOU LOSE YOUR DATA OR BRICK YOUR DEVICE. THE TOOL I SHARE HAVE WORKED FOR ME,
BUT THAT DOESN'T MEAN THAT YOU MAY NOT RUN INTO PROBLEMS. **BACKUP YOUR DATA.**
*******************************************************************************

No Donation

I've been asked quite few times about donation, (here, here ... just to list a few).

I'll put it here so that my stance is clear.

This program will remain totally free, ad free, even donation free, it's my way to give a little back to the community that has given me years of support and joy.

You can contribute by helping the next newcomer to learn the ropes and navigate through the maze of information.