MTK 8.1平台从内部存储实现OTA升级

1 需要关闭data区域加密

MTK_ENCRYPTION_DEFAULT_OFF = yes

MTK_ENCRYPTION_FDE_TO_FBE = no

MTK_ENCRYPTION_TYPE_FILE = no

/vendor/mediatek/proprietary/hardware/fstab/mtXXXX/fstab.in

5/* Can overwrite FDE setting by defining __MTK_FDE_NO_FORCE and __MTK_FDE_TYPE_FILE in this file */

6/* For example, you can un-comment the following line to disable FDE for all projects in this platform. */

7//#define __MTK_FDE_NO_FORCE //打开此项, 即默认不强制加密.

8#ifdef __MTK_FDE_NO_FORCE

9 #define FLAG_FDE_AUTO encryptable

10#else

11 #define FLAG_FDE_AUTO forceencrypt

12#endif

13#ifdef __MTK_FDE_TYPE_FILE

14 #define FLAG_FDE_TYPE fileencryption

15#else

16 #define FLAG_FDE_TYPE

17#endif

18#ifdef __MTK_FDE_TO_FBE

19 #define FLAG_FDE_TYPE forcefdeorfbe

20#else

21 #define FLAG_FDE_TYPE

22#endif

 

 

2 需要在recovery模式下更换升级路径

if(update_package != NULL) {

if(strncmp(update_package, "/storage/emulated/0/", 20) == 0) {

int len = strlen(update_package) + 20;

char* modified_path = (char*)malloc(len);

if (modified_path) {

strlcpy(modified_path, "/data/media/0/", len);

strlcat(modified_path, update_package+20, len);

ui->Print("(replacing path \"%s\" with \"%s\")\n",

update_package, modified_path);

update_package = modified_path;

} else {

ui->Print("modified_path allocation failed\n");

}

}

}

 

可以自己尝试在recovery 模式下挂载system区域和data区域

mount -rw -t ext4 /dev/block/mmcblk0p24 /data

mount -rw -t ext4 /dev/block/mmcblk0p23 /cache

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值