Archive for September, 2021

How to Install / Flash Android Factory Images via Fastboot

Today I attempted flashing my Android Pixel 4a with Android Factory Images, and realize all the documentation on the web are not working for me. So what worked for me as documented below, is nowhere to be found anywhere else.

Method 1: https://developers.google.com/android/images?hl=en

And click on the “flash”, which may require you to go back and “prepare” the phone for flashing (3 requirements for flashing: 1. USB debugging must be enabled 2. OEM bootunlocking must be enabled 3. on the phone itself, you must “allow files transfer via USB permission to be enable”.)

End of the all the attempts: FAILED. This method of flashing does not work for me, inspite of so many ways of trying.

But after some trying, I did manage to get the “Not connected” to become “connected”:

And the Android phone itself will also be rebooted into bootloader mode, AND STUCK THERE like below (except the state is “LOCKED” bootloader stage).    So question is WHO and HOW is it going to be “bootloader unlock” – the browser kept looping until error and the bootloader is still always locked.   I think command line way of bootloader unlocking is much more reliable.

f5018023-283b-440a-928f-3d8a2d81c61e

So I attempted the next method.

Method 2: Download the images and flash it via command line.

Using the following link,

https://nerdschalk.com/flash-firmware-factory-image-google-pixel/

Does the procedure above worked? NO, it does not worked for me too. So what is the change?

Firstly no where it mentioned unlocking the bootloader, which for me is still in locked stage.

The answer  (XXXXX is the serial number of the phone which appear in my “dmesg” output after connection) – assuming the current directory is the Android SDK where “fastboot” is located:

./fastboot flashing unlock -s XXXXX
< waiting for XXXXX >

Not working, as the command is perpetually waiting for input from the phone.   So next:

sudo ./fastboot flashing unlock -s XXXXX
[sudo] password for tteikhua:
OKAY [ 0.030s]
Finished. Total time: 0.030s

Worked.   The command “fastboot” need root permission to access the hardware.

Next problem is in Step 6:

First unpack the download from “factory images download”:

Then after ensuring “fastboot” and “adb” command are in the $PATH environment variable (because “flash-all.sh” script requires them) then the following:

As seen above, using a normal user, (non-root user) I kept getting “waiting for any device” message from “fastboot” command, which is essentially what “flash-all.sh” contained.

Flashing as a normal user is NOT working at all.

So “sudo” as root, and set the path to access all the “adb, fastboot” utililities as provided by Android SDK, and VIOLA the flashing start immediately (as root user):

And flashing continues:

So it worked.

After all these flashing, the last step is to revert back the bootloader to its locked mode.   As mentioned here:

https://forum.xda-developers.com/t/does-locking-the-bootloader-really-wipe-user-data.3600873/

“Locking the bootloader does not wipe away the user data”, even though unlocking do.      So I lock the bootloader via the following command:

sudo ./fastboot flashing lock -s 12271JEC210129
[sudo] password for tteikhua:
OKAY [ 0.101s]
Finished. Total time: 0.101s

And next moment, upon booting up, the mobile phone was in its initial reset mode:  ALL DATA WIPED OUT.

Still trying to figure out the reasoning for all these.   Why must be user data be wipe out?

Reference:

https://source.android.com/setup/contribute/flash

https://flash.android.com/

https://developers.google.com/android/images?hl=en

https://www.xda-developers.com/google-pixel-4a-how-to-unlock-bootloader-root-pass-safetynet/

How to downgrade from the Android 11 Beta 3 to Android 10 on Google Pixel [Video]

https://smartandroid.fr/en/comment-flasher-un-google-pixel-4a/

https://source.android.com/setup/contribute/flash

https://www.androidcentral.com/how-update-software-your-google-pixel

https://www.hardreset.info/devices/google/google-pixel-4a/faq/firmware-flash/

https://www.resetfree.com/flash-file-google-pixel-4a/

Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog