马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
在执行 adb remount 时高版本经常会提示失败
此时就必要对设备的进行解锁操作。记载两个部分,Google解锁和展锐解锁。
目录
一、Google解锁
二、展锐解锁
三、增补跳过按键检测的方案
一、Google解锁
官网介绍的unlock方法如下:锁定/解锁引导加载步伐 | Android Open Source Project
简单总结一下必要的步骤如下:
1、进入引导加载步伐
2、解锁引导加载步伐(设备处于lock状态,进行unlock)
3、锁定引导加载步伐(设备处于unlock状态,进行lock)
二、展锐解锁
我们使用的是展锐的芯片,根据以上步骤操作会提示未知的命令,如下图:
查阅了相干的 《Android 12.0 Secure Boot使用指南V1.0.pdf》、《Android 14 Secure Boot使用指南V1.0.pdf》 都有介绍详细流程。这里根据自己明白记载下必要的操作。
1、进入引导加载步伐
2、获取当前手机的id
- fastboot oem get_identifier_token
复制代码
3、天生解锁凭据 certificate.bin(ubuntu情况下)
脚本路径为:vendor/sprd/tools/packimage_scripts
秘钥路径为:bsp/tools/secureboot_key/config/rsa4096_vbmeta.pem
- vendor/sprd/tools/packimage_scripts$ ./signidentifier_unlockbootloader.sh 上一步获取到的id ../../../../bsp/tools/secureboot_key/config/rsa4096_vbmeta.pem certificate.bin
复制代码 4、PC上执行如下的解锁指令,必要在设备侧按音量下键确认
- fastboot flashing unlock_bootloader certificate-b.bin
复制代码
然后重启设备即可。
5、PC上执行如下的锁定指令
注意:必要使用平台编译天生的 fastboot,编译指令为 make fastboot。天生路径为out/host/windows-x86
三、增补跳过按键检测的方案
- bsp/bootloader/lk
- diff --git a/app/sprdboot/fastboot.c b/app/sprdboot/fastboot.c
- index 7291950a..679bb2b8 100755
- --- a/app/sprdboot/fastboot.c
- +++ b/app/sprdboot/fastboot.c
- @@ -3137,12 +3137,15 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- fastboot_okay("Bootloader has been locked!\n");
- return;
- }
- -
- + // lichang 忽略按键选项,直接lock
- + /*@start*/
- lcd_printf("\n Warning: lock device may erase user data.\n");
- + lcd_printf("\n Ignore key.\n");
- + /*
- lcd_printf(" Press volume down button to confirm that.\n");
- lcd_printf(" Press volume up button to cancel.\n");
- while(!butt_check) {
- - /* continue check till button pressed */
- + *//* continue check till button pressed *//*
- key_code = wait_for_keypress();
- if (key_code == KEY_VOLUMEDOWN) {
- butt_check = true;
- @@ -3151,7 +3154,8 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- fastboot_okay("Info:user cancel lock bootloader! ");
- return;
- }
- - }
- + }*/
- + /*@end*/
- lcd_printf(" Begin to erase user data...\n");
- if (0 != common_raw_erase("userdata", 0, 0)) {
- debugf("erase userdata failed\n");
- @@ -3191,11 +3195,15 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- return;
- }
-
- + // lichang 忽略按键选项,直接lock
- + /*@start*/
- lcd_printf("\n Warning: lock device may erase user data.\n");
- + lcd_printf("\n Ignore key.\n");
- + /*
- lcd_printf(" Press volume down button to confirm that.\n");
- lcd_printf(" Press volume up button to cancel.\n");
- while(!butt_check) {
- - /* continue check till button pressed */
- + *//* continue check till button pressed *//*
- key_code = wait_for_keypress();
- if (key_code == KEY_VOLUMEDOWN) {
- butt_check = true;
- @@ -3204,7 +3212,8 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- fastboot_okay("Info:user cancel lock bootloader! ");
- return;
- }
- - }
- + }*/
- + /*@end*/
- lcd_printf(" Begin to erase user data...\n");
- if (0 != common_raw_erase("userdata", 0, 0)) {
- debugf("erase userdata failed\n");
- @@ -3259,10 +3268,14 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- //memset(product_sn_signature, 0, sizeof(product_sn_signature));
-
- lcd_printf("\n Warning: Unlock device may erase user data.\n");
- + //lichang 忽略按键,直接unlock
- + /*@start*/
- + /*
- + lcd_printf(" Ignore key.\n");
- lcd_printf(" Press volume down button to confirm that.\n");
- lcd_printf(" Press volume up button to cancel.\n");
- while(!butt_check) {
- - /* continue check till button pressed */
- + *//* continue check till button pressed *//*
- key_code = wait_for_keypress();
- if (key_code == KEY_VOLUMEDOWN) {
- butt_check = true;
- @@ -3271,7 +3284,8 @@ void fb_cmd_flashing(const char *arg, void *data, uint64_t sz)
- fastboot_okay("Info:user cancel unlock bootloader! ");
- return;
- }
- - }
- + }*/
- + /*@end*/
- lcd_printf(" Begin to erase user data...\n");
- if (0 != common_raw_erase("userdata", 0, 0)) {
- debugf("erase userdata failed\n");
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |