在open harmony 中,如何定制化Launcher.hap;
以下以 open harmony 3.2-Bate1系統(tǒng),rk3568 為例
1、在 https://gitee.com/openharmony/developtools_hapsigner 倉(cāng)庫(kù)的dist 中獲取了 p12 文件,
2、根據(jù)p12生成配置簽名cer 文件
## .csr
keytool -certreq -alias "OpenHarmony Application Release" -keystore E:\signcenter_tool\key\OpenHarmony.p12 -storetype pkcs12 -file E:\signcenter_tool\key\OpenHarmony.csr
## .cer
## 需要進(jìn)入Openharmony SDK路徑/toolchain/lib目錄下執(zhí)行
keytool -gencert -alias "OpenHarmony Application CA" -infile E:\signcenter_tool\key\OpenHarmony.csr -outfile E:\signcenter_tool\key\OpenHarmony.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc
3、在 https://gitee.com/openharmony/applications_launcher.git 下載對(duì)應(yīng) 系統(tǒng)分支(3.2bate)的代碼,進(jìn)行修改,定制化從此開(kāi)始
ps:可以下載relase 的分支代碼。但是需要注意 p7b 文件可能會(huì)更換;
4、配置簽名,代碼分支下的p7b文件,生成的cer 文件,和 1中 p12 文件到簽名配置,配置到代碼中
"material": {
"storePassword": "**********************************",
"certpath": "D:/OpenHarmony/Sign/dist/OpenHarmony.cer",
"keyAlias": "OpenHarmony Application Release",
"keyPassword": "*******************************",
"profile": "D:/OpenHarmony/applications_launcher/signature/launcher3.2.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "D:/OpenHarmony/Sign/dist/OpenHarmony.p12"
}
5、編譯生成hap 包,hdc send 文件到指令路徑下,system/app/com.ohos.launcher 下
hdc file send .\phone-launcher-default-signed.hap system/app/com.ohos.launcher/Launcher.hap
此處如果傳遞文件有問(wèn)題 Error opening file: read-only file system,改下
hdc shell
mount -o remount,rw /
再進(jìn)行傳遞,是否需要修改 Launcher.hap 的文件權(quán)限,看需要
chmod 777 Launcher.hap
6、刪除配置之前安裝數(shù)據(jù),重啟
hdc shell
rm -rf /data/misc_de/0/mdds/0/default/bundle_manager_service
rm -rf /data/accounts
reboot
建議 直接刪除 data下所有數(shù)據(jù)后重啟
rm -rf /data/
reboot
完成
修改后的簡(jiǎn)單演示gif:
IMG_1804.GIF