【OpenHarmony應(yīng)用開(kāi)發(fā)】定制化Launcher

在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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容