Android 第三方 Recovery 繁體中文編譯教學
從零開始的編譯指南
挑選一個想要編譯的 Recovery
先備知識
- Linux 終端指令語法
- git 指令(至少需要基礎的能力)
- 永不放棄的心
- 一顆清晰的頭腦
配置一台主機
- CPU:至少4核心,建議8核心
- RAM:至少4GB (Android 10),建議配置8GB以上
- 儲存空間容量:至少50GB,建議100GB
- 儲存裝置類型:HDD即可 (SATA 3),SSD更好
- 系統:初學者建議安裝 Ubuntu 18.04 LTS / Ubuntu 20.04 LTS
安裝必要的編譯套件
設定 git
同步 Recovery 原始碼
參考各個 Android Custom Recovery 的編譯 Manifest
本文皆以 Orange Fox Recovery Project 與 ASUS ZenFone 4 Max (X00I)進行舉例
更新原始碼
- 在這之後如果有需要更新原始碼,請使用 repo sync 進行同步(更新 Recovery 原始碼)
- 待原始碼同步完成之後,還需要配置 TWRP Device Tree
同步 TWRP Device Tree
範例如下:
範例如下:
編譯 Orange Fox Recovery Project 使用的參數
官方支援參數列表
腳本
編譯 OFRP 腳本
範例如下:
Happy Hacking!
其他注意事項
編譯 Recovery 是一個不小的工程
- 推薦在編譯的時候使用 tmux 指令去新增一個 session 以便把當前的工作階段保留在後台
- 如果要上傳檔案到雲端硬碟,推薦使用 rclone 上傳檔案
- 需要熟悉 git 指令
- 建議編寫一些簡單的腳本方便自己執行命令
參考資料連結
- tmux
- tee
- rclone
- git
修改 Commit 紀錄
剛才的 Commit 後悔了,想要拆掉重做…
追加檔案到最近一次的 Commit
同步遠端分支
Git 基礎 - 與遠端協同工作
rename git branch locally and remotely
Git cherry-pick from another repository
使用 Git 時如何做出跨 repo 的 cherry-pick
git 場景 :從一個分支cherry-pick多個commit
合併發生衝突了,怎麼辦?
下載Github上特定Repository內的資料夾
Q&A
- 編譯過程遇到 FAILED 的時候,可以嘗試去看看哪個檔案造成的,它會寫在 FAILED 的後方
- 如果真的遇到自己無法解決的問題,可以加入這兩個 Telegram 群組
Android Building Help
RomDevelopment
- 快速上手 Android Custom ROM 適配 - Prebuilt Vendor
- 等我想到還有什麼問題再加上來
聯絡我
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →