Android11 刷机教程

0x0 背景

需要使用Piexl 3a手机刷Android 11系统。

0x1 下载刷机包

先访问Google的官方刷机包下载地址:https://developer.android.google.cn/preview/download
选择对应机型的刷机包:
在这里插入图片描述

0x2 安装

0x20 刷机包文件解析

解压刷机包,得到如下的文件:
在这里插入图片描述
核心文件:

  1. bootloader-sargo-b4s4-0.3-6622442.img :引导程序
  2. radio-sargo-g670-00067-200702-b-6648702.img:射频相关程序
  3. image-sargo-rpb3.200720.005.zip:刷机包镜像相关程序

脚本:

  1. flash-all.bat
@ECHO OFF
:: Copyright 2012 The Android Open Source Project
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

PATH=%PATH%;"%SYSTEMROOT%\System32"
fastboot flash bootloader bootloader-sargo-b4s4-0.3-6622442.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-sargo-g670-00067-200702-b-6648702.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-sargo-rpb3.200720.005.zip

echo Press any key to exit...
pause >nul
exit

实际可以看成3个部分:

1. fastboot flash bootloader bootloader-sargo-b4s4-0.3-6622442.img
2. fastboot flash radio radio-sargo-g670-00067-200702-b-6648702.img
3. fastboot -w update image-sargo-rpb3.200720.005.zip

.bat脚本方便windows平台下使用,但是需要安装adb工具。双击这个.bat文件就能运行。

  1. flash-all.sh
    该部分内容和上面的flash-all.bat相识,只不过使用shell脚本写了一遍
    在Linux下使用该脚本的方式:
chmod a+x flash-all.sh #先给shell脚本文件可执行权限
bash flash-all.sh # 触发shell脚本运行

内容如下:

#!/bin/sh

# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if ! [ $($(which fastboot) --version | grep "version" | cut -c18-23 | sed 's/\.//g' ) -ge 2802 ]; then
  echo "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
  exit 1
fi
fastboot flash bootloader bootloader-sargo-b4s4-0.3-6622442.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-sargo-g670-00067-200702-b-6648702.img
fastboot reboot-bootloader
sleep 5
fastboot -w update image-sargo-rpb3.200720.005.zip
  1. flash-base.sh
    该文件比flash-all.sh就少了下面这一句。
fastboot -w update image-sargo-rpb3.200720.005.zip

flash-base.sh内容如下:

#!/bin/sh

# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if ! [ $($(which fastboot) --version | grep "version" | cut -c18-23 | sed 's/\.//g' ) -ge 2802 ]; then
  echo "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
  exit 1
fi
fastboot flash bootloader bootloader-sargo-b4s4-0.3-6622442.img
fastboot reboot-bootloader
sleep 5
fastboot flash radio radio-sargo-g670-00067-200702-b-6648702.img
fastboot reboot-bootloader
sleep 5

0x21 进入fasterboot模式

开机状态下长按“电源键 + 音量下键” 10s左右。
在这里插入图片描述
补充:如果机器是locked状态,需要先解锁
fastboot flashing unlock

0x22 刷机

Windows:
双击flash-all.bat文件即可

Linux:

chmod a+x flash-all.sh #先给shell脚本文件可执行权限
bash flash-all.sh # 触发shell脚本运行

这个过程会有一点慢,不用点击任何手机上任何键,等着就好,下面是安装过程中的命令行的输出:

➜  sargo-rpb3.200720.005 bash flash-all.sh
Sending 'bootloader_a' (8369 KB)                   OKAY [  0.370s]
Writing 'bootloader_a'                             (bootloader) Flashing Pack version b4s4-0.3-6622442
(bootloader) Flashing partition table for Lun = 0
(bootloader) Flashing partition xbl_a
(bootloader) Flashing partition xbl_config_a
(bootloader) Flashing partition tz_a
(bootloader) Flashing partition aop_a
(bootloader) Flashing partition hyp_a
(bootloader) Flashing partition keymaster_a
(bootloader) Flashing partition cmnlib_a
(bootloader) Flashing partition cmnlib64_a
(bootloader) Flashing partition abl_a
(bootloader) Flashing partition devcfg_a
(bootloader) Flashing partition qupfw_a
(bootloader) Flashing partition storsec_a
OKAY [  0.308s]
Finished. Total time: 0.883s
Rebooting into bootloader                          OKAY [  0.051s]
Finished. Total time: 0.151s
Sending 'radio_a' (73340 KB)                       OKAY [  2.470s]
Writing 'radio_a'                                  (bootloader) Flashing Pack version SSD:g670-00067-200702-B-6648702
(bootloader) Flashing partition modem_a
OKAY [  0.578s]
Finished. Total time: 3.248s
Rebooting into bootloader                          OKAY [  0.051s]
Finished. Total time: 0.201s
--------------------------------------------
Bootloader Version...: b4s4-0.3-6622442
Baseband Version.....: g670-00067-200702-B-6648702
Serial Number........: 97GAY10NQN
--------------------------------------------
extracting android-info.txt (0 MB) to RAM...
Checking 'product'                                 OKAY [  0.060s]
Checking 'version-bootloader'                      OKAY [  0.060s]
Checking 'version-baseband'                        OKAY [  0.060s]
Setting current slot to 'a'                        OKAY [  0.066s]
extracting boot.img (64 MB) to disk... took 0.202s
archive does not contain 'boot.sig'
Sending 'boot_a' (65536 KB)                        OKAY [  2.210s]
Writing 'boot_a'                                   OKAY [  0.424s]
extracting dtbo.img (8 MB) to disk... took 0.017s
archive does not contain 'dtbo.sig'
Sending 'dtbo_a' (8192 KB)                         OKAY [  0.360s]
Writing 'dtbo_a'                                   OKAY [  0.125s]
archive does not contain 'dt.img'
archive does not contain 'recovery.img'
extracting vbmeta.img (0 MB) to disk... took 0.000s
archive does not contain 'vbmeta.sig'
Sending 'vbmeta_a' (4 KB)                          OKAY [  0.120s]
Writing 'vbmeta_a'                                 OKAY [  0.068s]
archive does not contain 'vbmeta_system.img'
archive does not contain 'vendor_boot.img'
extracting super_empty.img (0 MB) to disk... took 0.000s
Rebooting into fastboot                            OKAY [  0.060s]
< waiting for any device >
Sending 'system_a' (4 KB)                          OKAY [  0.001s]
Updating super partition                           OKAY [  0.006s]
Resizing 'product_a'                               OKAY [  0.005s]
Resizing 'system_a'                                OKAY [  0.004s]
Resizing 'system_ext_a'                            OKAY [  0.004s]
Resizing 'vendor_a'                                OKAY [  0.004s]
archive does not contain 'boot_other.img'
archive does not contain 'odm.img'
extracting product.img (1697 MB) to disk... took 6.635s
archive does not contain 'product.sig'
Resizing 'product_a'                               OKAY [  0.005s]
Sending sparse 'product_a' 1/7 (262140 KB)         OKAY [  8.542s]
Writing 'product_a'                                OKAY [  2.831s]
Sending sparse 'product_a' 2/7 (262140 KB)         OKAY [  8.556s]
Writing 'product_a'                                OKAY [  1.798s]
Sending sparse 'product_a' 3/7 (262140 KB)         OKAY [  8.543s]
Writing 'product_a'                                OKAY [  1.814s]
Sending sparse 'product_a' 4/7 (262140 KB)         OKAY [  8.527s]
Writing 'product_a'                                OKAY [  1.817s]
Sending sparse 'product_a' 5/7 (262140 KB)         OKAY [  8.557s]
Writing 'product_a'                                OKAY [  1.784s]
Sending sparse 'product_a' 6/7 (262140 KB)         OKAY [  8.546s]
Writing 'product_a'                                OKAY [  1.808s]
Sending sparse 'product_a' 7/7 (165268 KB)         OKAY [  5.393s]
Writing 'product_a'                                OKAY [  1.204s]
extracting system.img (785 MB) to disk... took 3.159s
archive does not contain 'system.sig'
Resizing 'system_a'                                OKAY [  0.005s]
Sending sparse 'system_a' 1/4 (262140 KB)          OKAY [  8.542s]
Writing 'system_a'                                 OKAY [  2.817s]
Sending sparse 'system_a' 2/4 (262140 KB)          OKAY [  8.533s]
Writing 'system_a'                                 OKAY [  1.811s]
Sending sparse 'system_a' 3/4 (262140 KB)          OKAY [  8.507s]
Writing 'system_a'                                 OKAY [  1.817s]
Sending sparse 'system_a' 4/4 (18120 KB)           OKAY [  0.592s]
Writing 'system_a'                                 OKAY [  0.168s]
extracting system_ext.img (181 MB) to disk... took 0.645s
archive does not contain 'system_ext.sig'
Resizing 'system_ext_a'                            OKAY [  0.005s]
Sending 'system_ext_a' (186144 KB)                 OKAY [  6.002s]
Writing 'system_ext_a'                             OKAY [  2.317s]
extracting system_other.img (72 MB) to disk... took 0.242s
archive does not contain 'system.sig'
Sending 'system_b' (74668 KB)                      OKAY [  2.391s]
Writing 'system_b'                                 OKAY [  0.511s]
extracting vendor.img (452 MB) to disk... took 1.819s
archive does not contain 'vendor.sig'
Resizing 'vendor_a'                                OKAY [  0.005s]
Sending sparse 'vendor_a' 1/2 (262140 KB)          OKAY [  8.513s]
Writing 'vendor_a'                                 OKAY [  2.843s]
Sending sparse 'vendor_a' 2/2 (201016 KB)          OKAY [  6.546s]
Writing 'vendor_a'                                 OKAY [  1.415s]
archive does not contain 'vendor_other.img'
Erasing 'userdata'                                 OKAY [  0.093s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata'                                 OKAY [  0.006s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 167.524s

然后就能看到首次启动的设置界面了,恭喜你可以体验Android11 了。

如果对你有帮助点点关注,支持一下作者吧。

  • 6
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
刷机所需的Android 9 GMS刷机教程可以分为以下几个步骤: 1.备份数据:在开始刷机之前,请务必备份手机中重要的数据,如联系人、短信、照片等。这是为了防止数据丢失或损坏。 2.解锁Bootloader:在刷机之前,需要先解锁手机的Bootloader。这可以通过在开发者选项中启用OEM解锁和USB调试,然后在电脑上使用ADB和Fastboot工具来完成。 3.安装刷机工具和驱动程序:下载适用于Android 9的刷机工具和驱动程序,如ADB和Fastboot。安装这些工具可以让您在刷机过程中进行操作和调试。 4.下载适用于您的设备的Android 9 GMS固件文件:在刷机之前,请确保您下载并准备好正确的Android 9 GMS固件文件。这些固件文件可以从官方网站或第三方提供商的论坛上获取。 5.进入刷机模式:将您的设备关机,然后按下特定的硬件组合键(通常是音量下键+电源键)进入刷机模式。 6.使用Fastboot刷入固件:打开命令提示符或终端窗口,使用Fastboot命令将Android 9 GMS固件刷入设备。例如,使用"fastboot flash system system.img"命令来刷入系统分区。 7.清除缓存和重启:完成刷机后,使用Fastboot命令清除缓存分区,然后重新启动设备。这确保了设备能够正常启动到新的Android 9 GMS固件。 请注意,刷机有一定的风险,可能会导致设备损坏或失去保修。在进行刷机之前,请确保您了解并理解此过程,并小心操作。最好在刷机之前参考相关的刷机教程和论坛,以获得更详细的指导。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值