问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

android2.3系统laaboo手机recovery模式怎么选择

发布网友 发布时间:2022-10-19 01:58

我来回答

3个回答

热心网友 时间:2024-11-17 08:21

  Recovery Binary 是 Android 进入 Recovery 模式所运行的程序,实现了 Recovery 模式下的功能。它由目录
bootable/recovery 下的源代码编译生成。头文件 bootable/recovery/recovery_ui.h 定义了 Recovery UI
的接口,bootable/recovery/default_recovery_ui.c 是其默认实现,每个设备可以有自己不同的实现,然后通过变量
TARGET_RECOVERY_UI_LIB 来指定,否则使用默认实现。

  # bootable/recovery/Android.mk

  ifeq ($(TARGET_RECOVERY_UI_LIB),)

  LOCAL_SRC_FILES + = default_recovery_ui.c

  else

  LOCAL_STATIC_LIBRARIES + = $(TARGET_RECOVERY_UI_LIB)

  endif

  Recovery Image:

  Recovery Image 的生成规则在文件 build/core/Makefile 中定义,具体分析如下:

  # build/core/Makefile

  # -----------------------------------------------------------------

  # Recovery image

  # If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true

  ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)
$(BUILD_TINY_ANDROID)))

  INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img

  recovery_initrc := $(call include-path-for, recovery)/etc/init.rc

  recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery
system

  recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img

  recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET)

  recovery_binary := $(call
intermediates-dir-for,EXECUTABLES,recovery)/recovery

  recovery_resources_common := $(call include-path-for, recovery)/res

  recovery_resources_private := $(strip
$(wildcard$(TARGET_DEVICE_DIR)/recovery/res))

  recovery_resource_deps := $(shell find $(recovery_resources_common) \

  $(recovery_resources_private) -type f)

  recovery_fstab := $(strip $(wildcard
$(TARGET_DEVICE_DIR)/recovery.fstab))

  recovery_mmc_fstab := $(strip
$(wildcard$(TARGET_DEVICE_DIR)/recovery_mmc.fstab))

  ifeq ($(recovery_resources_private),)

  $(info No private recovery resources for TARGET_DEVICE
$(TARGET_DEVICE))

  endif

  ifeq ($(recovery_fstab),)

  $(info No recovery.fstab for TARGET_DEVICE $(TARGET_DEVICE))

  endif

  INTERNAL_RECOVERYIMAGE_ARGS := \

  $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \

  --kernel $(recovery_kernel) \

  --ramdisk $(recovery_ramdisk)

  # Assumes this has already been stripped

  ifdef BOARD_KERNEL_CMDLINE

  INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"

  endif

  ifdef BOARD_KERNEL_BASE

  INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)

  endif

  BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))

  ifdef BOARD_KERNEL_PAGESIZE

  INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)

  endif

  INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img

  kernel: $(INSTALLED_BOOTIMAGE_TARGET)

  .PHONY: kernel

  # Keys authorized to sign OTA packages this build will accept. The

  # build always uses test-keys for this; release packaging tools will

  # substitute other keys for this one.

  OTA_PUBLIC_KEYS := $(SRC_TARGET_DIR)/proct/security/testkey.x509.pem

  # Generate a file containing the keys that will be read by the

  # recovery binary.

  RECOVERY_INSTALL_OTA_KEYS := \

  $(call intermediates-dir-for,PACKAGING,ota_keys)/keys

  DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/mpkey.jar

  $(RECOVERY_INSTALL_OTA_KEYS): PRIVATE_OTA_PUBLIC_KEYS :=
$(OTA_PUBLIC_KEYS)

  $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR)

  @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS)"

  @rm -rf $@

  @mkdir -p $(dir $@)

  java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) > $@

  $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP)
\

  $(INSTALLED_RAMDISK_TARGET) \

  $(INSTALLED_BOOTIMAGE_TARGET) \

  $(recovery_binary) \

  $(recovery_initrc) $(recovery_kernel) \

  $(INSTALLED_2NDBOOTLOADER_TARGET) \

  $(recovery_build_prop) $(recovery_resource_deps) \

  $(recovery_fstab) \

  $(RECOVERY_INSTALL_OTA_KEYS)

  /* 以正常系统的根文件系统为基础构建 Recovery 的根文件系统 */

  @echo ----- Making recovery image ------

  rm -rf $(TARGET_RECOVERY_OUT)

  mkdir -p $(TARGET_RECOVERY_OUT)

  mkdir -p $(TARGET_RECOVERY_ROOT_OUT)

  mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/etc

  mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/tmp

  echo Copying baseline ramdisk...

  cp -R $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)

  /* 删除所有的 Init 脚本,使用 Recovery 特定的 Init 脚本 */

  rm $(TARGET_RECOVERY_ROOT_OUT)/init*.rc

  echo Modifying ramdisk contents...

  cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/

  /* 添加 Recovery Binary */

  cp -f $(recovery_binary) $(TARGET_RECOVERY_ROOT_OUT)/sbin/

  /* 添加通用的和设备特定的 Recovery 资源 */

  cp -rf $(recovery_resources_common) $(TARGET_RECOVERY_ROOT_OUT)/

  $(foreach item,$(recovery_resources_private), \

  cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/)

  /* 添加设备特定的文件系统表 */

  $(foreach item,$(recovery_fstab), \

  cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab)

  $(foreach item,$(recovery_mmc_fstab), \

  cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery_mmc.fstab)

  /* 内嵌验证签名的公钥 */

  cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys

  /* 生成 Recovery 模式的默认属性文件 */

  cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \

  > $(TARGET_RECOVERY_ROOT_OUT)/default.prop

  /* 生成 Recovery 的根文件系统 ramdisk-recovery.img */

  $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) >
$(recovery_ramdisk)

  /* 把正常系统的内核跟 ramdisk-recovery.img 打包生成 Recovery Image */

  $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@

  @echo ----- Made recovery image -------- $@

  /* 验证生成的 Recovery Image 有没有超出 Recovery 分区的大小 */

  $(hide) $(call
assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)

  else

  INSTALLED_RECOVERYIMAGE_TARGET :=

  endif

  .PHONY: recoveryimage

  recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET)

  Recovery Init Script:

  从上面的分析可以看出 recovery.img 和 boot.img 的区别不大,主要是 init 脚本不一样,recovery 的 init
脚本相对简单,系统起来后只运行 ueventd、recovery、adbd 三个服务。

  # bootable/recovery/etc/init.rc

  on early-init

  start ueventd

  on init

  export PATH /sbin

  export ANDROID_ROOT /system

  export ANDROID_DATA /data

  export EXTERNAL_STORAGE /sdcard

  symlink /system/etc /etc

  mkdir /sdcard

  mkdir /system

  mkdir /data

  mkdir /cache

  mount /tmp /tmp tmpfs

  on boot

  ifup lo

  hostname localhost

  domainname localdomain

  class_start default

  service ueventd /sbin/ueventd

  critical

  service recovery /sbin/recovery

  service adbd /sbin/adbd recovery

  disabled

  on property:persist.service.adb.enable=1

  start adbd

  on property:persist.service.adb.enable=0

  stop adbd

  Android <----> Recovery Binary <----> Bootloader:

  有时候 Android 需要不同的模式互相协助来完成一项任务,这样不同模式之间就要有一种机制来交换信息。Recovery Binary 和
Bootloader 之间是通过 misc 分区来传递信息的,如果是 MTD 设备,则使用 misc 分区的第二个页面,如果是块设备,则使用 misc
分区的第一块,交换的信息通过如下结构体封装。Recovery Binary 和 Android 之间是通过 cache
分区下的如下几个固定文件来传递信息的。

  /* Recovery Binary <----> Bootloader */

  struct bootloader_message {

  char command[ 32];

  char status[ 32];

  char recovery[ 1024];

  };

  /* Recovery Binary <----> Android */

  /cache/recovery/command

  /cache/recovery/intent

  /cache/recovery/log

  /cache/recovery/last_log

  Updater Binary:

  Updater Binary 是 OTA package 的安装程序,被打包到 OTA package 中一起发布。Updater Binary
的源代码位于目录 bootable/recovery/updater 中。每个设备都可以为 Updater Binary
添加自己特定的扩展,然后通过变量TARGET_RECOVERY_UPDATER_LIBS 和
TARGET_RECOVERY_UPDATER_EXTRA_LIBS 来指定。

  # bootable/recovery/updater/Android.mk

  LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) \

  $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)

  LOCAL_STATIC_LIBRARIES + = libapplypatch libedify libmttils libminzip
libz

  LOCAL_STATIC_LIBRARIES + = libmincrypt libbz

  LOCAL_STATIC_LIBRARIES + = libcutils libstdc++ libc

  LOCAL_C_INCLUDES + = $(LOCAL_PATH)/..

  # Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function

  # named "Register_()". Here we emit a little C function that

  # gets #included by updater.c. It calls all those registration

  # functions.

  # Devices can also add libraries to TARGET_RECOVERY_UPDATER_EXTRA_LIBS.

  # These libs are also linked in with updater, but we don't try to call

  # any sort of registration function for these. Use this variable for

  # any subsidiary static libraries required for your registered

  # extension libs.

  inc := $(call
intermediates-dir-for,PACKAGING,updater_extensions)/register.inc

  # During the first pass of reading the makefiles, we mp the list of

  # extension libs to a temp file, then copy that to the ".list" file if

  # it is different than the existing .list (if any). The register.inc

  # file then uses the .list as a prerequisite, so it is only rebuilt

  # (and updater.o recompiled) when the list of extension libs changes.

  junk := $(shell mkdir -p $(dir $(inc));\

  echo $(TARGET_RECOVERY_UPDATER_LIBS) > $(inc).temp;\

  diff -q $(inc).temp $(inc).list || cp -f $(inc).temp $(inc).list)

  $(inc) : libs := $(TARGET_RECOVERY_UPDATER_LIBS)

  $(inc) : $(inc).list

  $(hide) mkdir -p $(dir $@)

  $(hide) echo "" > $@

  $(hide) $(foreach lib,$(libs),echo "extern void Register_$(lib)(void);"
>> $@)

  $(hide) echo "void RegisterDeviceExtensions() {" >> $@

  $(hide) $(foreach lib,$(libs),echo " Register_$(lib)();" >> $@)

  $(hide) echo "}" >> $@

  $(call intermediates-dir-for,EXECUTABLES,updater)/updater.o : $(inc)

  LOCAL_C_INCLUDES += $(dir $(inc))

热心网友 时间:2024-11-17 08:22

1 关机状态下
2 按主屏幕建(即home键)+音量上键+电源键
3 待屏幕有显示时 松开电源键 保持按住主屏幕键+音量上键
4 待进入recovery后全部松开
进入后 音量加减 控制上下 电源键是确定

热心网友 时间:2024-11-17 08:22

关机+音量上
关机+音量下
关机+音量上和音量下
menu键+音量上
menu键+音量下
menu键+音量上和音量下
总有一个是的,挨个试试吧。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
表格列求和公式怎么设置 求和函数公式怎么输入 北京注册成立一个公司需要多少钱 北京公司都是什么 手机导航地图语音怎么下载 如何分别真金和仿金首饰 怎样区分真金和仿金首饰呢 小学生新年晚会主持人的串词!!(不要太多)急 大大后天就需要了!!!_百度... 周年晚会策划公司 奥格瑞玛传送门大厅在哪 奥格瑞玛传送门大厅怎么走 想买个带NFC的手机,现在怎么买小米5便宜 先锋空调扇怎么样?评测介绍 武汉大学生落户 租/借住房屋落户审核严吗 离字组词 离字组词有哪些 武汉大学生落户需要什么材料 “垂”的反义词是什么? 垂下的近义词是什么 希区柯克的悬念故事集是他写的吗? 希区柯克有无真正写过小说? 希区柯克最经典的短篇小说 希区柯克的悬疑短篇小说(1) 楚江新材股最新持股,002171股最新持股 现在楚江新材有多少股东?楚江新材002171什么情况?楚江新材中报? 2022年中级会计财务管理考前备考技巧 什么除草剂可以杀死绞股蓝? 注销了,别人还能搜索到已经注销的号吗? 对方注销了发消息会有显示么? 问男性插着导尿管还能做尿流率检查吗 对方注销了发消息会有显示么? 尿流动力学检查怎么做?痛苦吗?检查目的是什么? Android userData分区大小查看 拾到一张没名字的公交卡,怎么发朋友圈 交了社保怎么发朋友圈 新版电脑系统桌面上的图标变大了怎么处理 石斛繁殖方法 被盗了,朋友圈被清空,好友全被拉黑,绑定手机号没了现在登不上申 ... 我看好一辆长安之星2代面包车,09年的,行使了6万公里,有空调,普配,不是... 20kb小于200k吗 小学毕业学生感恩老师的话语 魅族加密便签显示空白 如何给魅族Flyme5便签加密 山国饮艺茶老树白茶500克价格? 山国饮艺茶老树白茶500克价格? 华硕笔记本K55VD屏幕是多大的? 华硕笔记本K55VD显卡是什么型号的? 小米2s前后摄像头一样吗? 2021海宁中考分数线 面膜里那些成分孕妇不能用 眉心间长了好多脂肪粒怎么办 眉毛里面生有很多脂肪粒,怎么解决?