如何整合改裝專屬自己的rom ,並加入個人化補丁
首先請先準備2樣工具
Notepad ++
WinRAR
在一開始學習的時候,請用我的腳本邊看邊學
學習腳本
創建一個新資料夾,用WinRAR將檔案解壓縮到目錄下
按這裡檢視圖片
1.如何幫沒有data 資料夾的rom 加入支持 data ,將以下檔案加入資料夾
data
接下來要修改刷機腳本,用
Notepad ++打開 META-INF / com / google / android / updater-script
在一開始的地方找到一段
package_extract_dir("system", "/system");
加入
package_extract_dir("data", "/data");
在末端設置權限的Setting permissions 中 加入以下兩行
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
這樣就可以幫你的rom 加入data支持
按這裡檢視圖片
2.如何在刷機過程直接轉換成EXT4格式,將以下檔案加入資料夾
EXT4 優化
在updater-script 內容中加入
# Unmounting partitions
ui_print("Unmounting partitions...");
ui_print("");
ui_print("");
unmount("/system");
unmount("/data");
ui_print("");
ui_print("");
ui_print("Installing EXT4 Performance Tweak");
ui_print("");
ui_print("");
package_extract_file("initialize/ext4", "/tmp/ext4");
package_extract_file("initialize/tune2fs", "/tmp/tune2fs");
set_perm(0, 0, 0777, "/tmp/ext4");
set_perm(0, 0, 0777, "/tmp/tune2fs");
run_program("/tmp/ext4");
delete("/tmp/ext4");
按這裡檢視圖片
這樣就可以幫你的rom 加入EXT4 轉換
3.如何加入Sony_Bravia,將以下檔案加入資料夾指定位置
Sony_Bravia
在updater-script 內容中加入
set_perm_recursive(0, 0, 0755, 0755, "/system/etc/be_movie");
set_perm_recursive(0, 0, 0755, 0755, "/system/etc/be_photo");
4.加入Adrenaline Boost 深度內存整理,請將以下檔案加入資料夾指定bin位置
Adrenaline Boost
在updater-script 內容中加入
set_perm(0, 0, 0777, "/system/bin/boost");
5.加入Nano_editor 與 bash shell script 交叉編譯,讓系統執行任務時間縮短,請將以下檔案加入資料夾指定位置
bash_nano
在updater-script 內容中加入(因為在不同段落,請自己排列一下)
symlink("busybox", "/system/xbin/bash");
symlink("busybox", "/system/xbin/nano");
symlink("busybox", "/system/xbin/sysro");
symlink("busybox", "/system/xbin/sysrw");
symlink("/system/xbin/bash", "/system/bin/bash");
symlink("/system/xbin/nano", "/system/bin/nano");
symlink("/system/xbin/sysro", "/system/bin/sysro");
symlink("/system/xbin/sysrw", "/system/bin/sysrw");
set_perm(2000, 2000, 0755, "/system/xbin/bash");
set_perm(1000, 1000, 0755, "/system/xbin/nano");
set_perm(1000, 1000, 0755, "/system/xbin/sysro");
set_perm(1000, 1000, 0755, "/system/xbin/sysrw");
set_perm(0, 0, 0755, "/system/etc/bash.bashrc");
set_perm(0, 0, 0755, "/system/etc/profile");
set_perm(0, 0, 0755, "/system/etc/terminfo");
set_perm(0, 0, 0644, "/system/etc/terminfo/?/*");
set_perm(2000, 2000, 0755, "/data/local/.bash_aliases");
set_perm(2000, 2000, 0755, "/data/local/.bashrc");
set_perm(2000, 2000, 0755, "/data/local/.inputrc");
set_perm(2000, 2000, 0755, "/data/local/.profile");
6.加入SQLitem 優化 , 請將以下檔案加入資料夾指定位置
SQLitem
在updater-script 內容中加入
set_perm(0, 2000, 0755, "/system/xbin/sqlite3");
set_perm(0, 2000, 0755, "/system/xbin/sqlite3.jb");
set_perm(0, 2000, 0755, "/system/xbin/sqlite3.notjb");
如何打包完成作品
按這裡檢視圖片
記的選擇ZIP
按這裡檢視圖片
..............................................................................................
內容慢慢補上