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

三星S4在狀態列加入鎖屏按鈕的改機做法

編輯:進階使用

S4 支援各種個人化定製,其中一個小痛點是:每次鎖屏都得去按機身側邊的電源鍵。如果你希望能直接在下拉通知列裡點一下就鎖屏,可以透過修改 SystemUI 來加入這顆按鈕。

前置條件:設備已取得 Root 權限,並具備 APK 反編譯/回編譯工具與壓縮軟體。

具體步驟

1. 反編譯 SystemUI.apk。

2. 編輯 res\layout\status_bar.xml,在第 23 行後新增一行:

<com.android.systemui.statusbar.policy.keybuttonview android:contentdescription="@string/accessibility_back" android:id="@id/back" android:layout_gravity="right" android:layout_height="fill_parent" android:layout_torightof="@id/recent_apps" android:layout_width="wrap_content" android:paddingright="30.0dip" android:src="#00000000" android:orientation="vertical" systemui:glowbackground="@drawable/ic_sysbar_highlight" systemui:keycode="26" />

3. 存檔後關閉編輯器。

4. 在 res\drawable-xxhdpi 中放入名為 vk_sysbar_lock 的圖示檔。

5. 回編譯 SystemUI。

6. 用 WinRAR 等工具以「儲存」方式打開 SystemUI.apk,把改好的 status_bar.xml、resources 檔與 vk_sysbar_lock 圖片換回原位。

7. 複製回手機覆蓋原檔、修正權限(通常設為 644),重啟手機即完成。

風險提醒:SystemUI 是系統核心元件,改動失敗可能導致開機後沒有狀態列、無法進入桌面,甚至開機循環。操作前請務必備份原始 SystemUI.apk,並確認手機能進入 Recovery,以便隨時還原。

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