但是 Custom Update 大多需要使用 adb shell 去下指令.
這邊做了一個利用選單的 Custom Update Package, 提供更新者
可以簡單的做出選單來讓使用者更新時不再需要手動下指令.
![[2010040202] Milestone Custom Update Package](http://attach.mobile01.com/attach/201004/mobile01-5b9c5afd21cbea085d0b1ddbe55732cc.png)
工作原理:
這個由 Android Recovery 程式修改而來的 Custom Update,
解開後會有 update.zip 以及 CustomUpdate 目錄. 在 CustomUpdate
目錄下有 bin 以及 menu. 所有選單都是擺放在 menu 下面, 而
其中需要的 script 則是放在 bin 下面.
選單檔案內的項目是以 : 來做分隔. 總共有三個項目 "說明:功能:檔案"
例如: init.menu (預設選單)
Reboot system:reboot:
sprecovery initial:init:sprecovery_init.sh
sprecovery backup:shell:nandroid-mobile.sh -b -q
sprecovery restore:menu:sprecovery_restore.menu
sprecovery delete:menu:sprecovery_delete.menu
Root phone:shell:root.sh
Clear system cache:clear_cache:
Clear user data:clear_data:
Remove custom update package and reboot:clear_custom:
目前有的 "功能" 項目:
reboot: 重開機
init: 選單載入時自動執行, 這個項目不會在選單列表上面顯示出來.
藉由這個項目可以動態產生其他選單, 如範例中的 sprecovery
restore 與 delete 選單.
shell: 執行項目, 直接指定 CustomUpdate/bin 下的檔案名稱.
menu: 下一層選單, 直接指定 CustomUpdate/menu 下的檔案名稱.
clear_cache: 清除 CACHE 區塊, 與 Recovery 相同.
clear_data: 清除使用者 DATA 區塊, 與 Recovery 相同.
clear_custom: 刪除此工具.
Custom Update Package:
Milestone_Custom_Update_2010040501
Modified Android Recovery Source:
recovery_2010040202_wipe_custom
2010040501:
A. 修正 tar 問題.
2010040202:
A. 修正 "Clear custom update and reboot" 無法執行.
2010040201:
A. 修正 sh 問題.
B. 變更 shell 執行方式.
2010040101:
A. 增加 AdbRecovery.
B. Camera 按鍵可以當做 Select 功能.
C. 內部處理時 LED 會閃爍.
D. AdbRecovery 備份目錄 "Bb*-xxxxxxxx-xxxx" 必須擺在 nandroid/adbrecovery 下面.
E. 修正選單 bug.
2010033101:
A. 修正 sprecovery 無法備份 /data.