Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

中興 U930 狀態欄美化:時間置中、顯示電信商、改字色

編輯:Android 刷機技巧

狀態欄是最容易做出個人風格的地方。以下示範三件事:把時間置中、顯示電信商名稱、修改文字顏色。工具只需 apktool 與一個文字編輯器(建議 Notepad++)。

一、讓時間置中

1. 反編譯 systemui.apk。

2. 開啟 systemui\res\layout\status_bar.xml,找到 xmlns:android 宣告所在的那一行。

3. 在其下方插入:

<com.android.systemui.statusbar.Clock
android:textAppearance="@android:style/TextAppearance.StatusBar.Icon"
android:gravity="left|center" android:paddingRight="6.0dip"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:singleLine="true" />

關鍵是 layout_gravity="center_horizontal",它讓時鐘脫離原本的左對齊排版。

4. 回編譯 systemui 專案。

5. 從輸出目錄取出 status_bar.xml,覆蓋回原始 APK 的 res\layout 內。

二、在狀態欄顯示電信商

1. 同樣在 status_bar.xml,找到:

<LinearLayout android:orientation="horizontal" android:id="@id/icons"
android:layout_width="fill_parent" android:layout_height="fill_parent">

2. 在其下方加入:

<com.android.systemui.statusbar.CarrierLabel
android:textAppearance="@android:style/TextAppearance.StatusBar.Icon"
android:gravity="left|center" android:paddingLeft="6.0dip"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:singleLine="true" />

3. 回編譯並取出 status_bar.xml 覆蓋回原 APK。

三、修改文字顏色

最簡單的一項:只要在對應節點中插入 textColor 屬性。以時間置中那段為例,加上 ICS 藍的色碼:

android:textColor="#34b4e3"

插入後的完整節點:

<com.android.systemui.statusbar.Clock
android:textAppearance="@android:style/TextAppearance.StatusBar.Icon"
android:gravity="left|center" android:paddingRight="6.0dip"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:singleLine="true"
android:textColor="#34b4e3" />

電信商文字的颜色改法完全相同,色碼可自行上網查詢對照表。

四、把成品裝回手機

把 systemUI.apk 複製到電腦並改名為 systemUI.zip,用 RAR 或 7-Zip 打開,進入 res\layout 資料夾,解開 status_bar.zip 取得 status_bar.xml,拖曳進 layout 資料夾覆蓋,關閉視窗。

接著把副檔名改回 systemUI.apk,複製回手機,用 RE 管理器修正權限後覆蓋到 /system/app,重開機即可看到效果。

提醒

SystemUI 是開機必載服務,回編譯失敗或 XML 標籤沒閉合,會直接导致開機後不斷重啟。修改前請備份原始 systemui.apk,並確認 apktool 版本與韌體相符——不同 Android 版本對 framework 資源的要求不同,版本不合會在回編譯階段就失敗。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved