recovery常见配置修改

概述
简要介绍三点:

字符相关修改
方向修改
固件升级动画修改
配置修改
修改中英文
diff --git a/recovery.cpp b/recovery.cpp
index 10743c9…a9f41c5 100644
— a/recovery.cpp
+++ b/recovery.cpp
@@ -137,7 +137,7 @@ static const int BATTERY_WITH_CHARGER_OK_PERCENTAGE = 15;
constexpr const char* RECOVERY_WIPE = “/etc/recovery.wipe”;

RecoveryUI* ui = NULL;
-static const char* locale = “en_US”;
+static const char* locale = “zh_CN”;
char* stage = NULL;
char* reason = NULL;
bool modified_flash = false;
1
2
3
4
5
6
7
8
9
10
11
12
13
修改字符串资源

<?xml version="1.0" encoding="UTF-8"?>


“正在安装系统更新… 请勿断电”
“正在清除… 请勿断电”
“无命令。”
“出错了!”

1
2
3
4
5
6
7
8
参考文档:

如何修改Recovery的字符串资源

注意在Android中recovery_l10n工具目录改变为了以下路径:

bootable/recovery/tools/recovery_l10n
1
修改字符串资源属性(大小和颜色)
参考文档:

修改字符串资源属性

1.screen_ui.cpp

// Choose the right background string to display during update. +443
void ScreenRecoveryUI::SetSystemUpdateText(bool security_update) {
if (security_update) {
LoadLocalizedBitmap(“installing_security_text”, &installing_text);
} else {
LoadLocalizedBitmap(“installing_text”, &installing_text);
}
Redraw();
}
1
2
3
4
5
6
7
8
9
// Clear the screen and draw the currently selected background icon (if any). +145
// Should only be called with updateMutex locked.
void ScreenRecoveryUI::draw_background_locked() {
pagesIdentical = false;
gr_color(0, 0, 0, 255);
gr_clear();

if (currentIcon != NONE) {
    if (max_stage != -1) {
        int stage_height = gr_get_height(stageMarkerEmpty);
        int stage_width = gr_get_width(stageMarkerEmpty);
        int x = (gr_fb_width() - max_stage * gr_get_width(stageMarkerEmpty)) / 2;
        int y = gr_fb_height() - stage_height;
        for (int i = 0; i < max_stage; ++i) {
            GRSurface* stage_surface = (i < stage) ? stageMarkerFill : stageMarkerEmpty;
            gr_blit(stage_surface, 0, 0, stage_width, stage_height, x, y);
            x += stage_width;
        }
    }

    GRSurface* text_surface = GetCurrentText();
    int text_x = (gr_fb_width() - gr_get_width(text_surface)) / 2;
    int text_y = GetTextBaseline();
    gr_color(255, 255, 255, 255);
    gr_texticon(text_x, text_y, text_surface);
}

}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
修改字库(汉化)
Android的Recovery中font_10x18.h字库文件制作

无法生效可以查看上面修改字符串资源属性链接.

修改char_width和char_height可以修改字体大小

struct {
unsigned width;
unsigned height;
unsigned char_width;
unsigned char_height;
unsigned char rundata[2973];
} font = {
.width = 960,
.height = 18,
.char_width = 10,
.char_height = 18,
.rundata = {
1
2
3
4
5
6
7
8
9
10
11
12
更换文件

https://www.jianshu.com/p/3f5cf4599db2
1
recovery 方向修改
device/common/rk3399

diff --git a/BoardConfig.mk b/BoardConfig.mk
index 85df401…6bdc017 100755
— a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -84,7 +84,7 @@ BOARD_OPENGL_AEP := true
#90: ROTATION_RIGHT
#180: ROTATION_DOWN
#270: ROTATION_LEFT
-TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_NONE
+TARGET_RECOVERY_DEFAULT_ROTATION ?= ROTATION_RIGHT

ENABLE_CPUSETS := true
#for optee support

固件升级动画修改
目录:

bootable/recovery/res-xxxx/images
1
其中xxxx表示不同的分辨率.参考:https://www.cnblogs.com/codeking100/p/10338546.html

images目录中有升级动画的图片,名称为:loop000xx.png

根据自己定义的动画,转换为png图片替换该目录下的图片即可.
————————————————
版权声明:本文为CSDN博主「Letcos」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/m0_37631324/article/details/106198767

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值