Một số thiên tài trong cộng đồng Android đã tìm ra cách chỉnh sửa thanh điều hướng (navbar) để dùng file .gif động làm phím Home, và Appuals có hướng dẫn chi tiết!

Cảnh báo: Quy trình khá phức tạp. Bạn cần decompile SystemUI.apk, sửa file quan trọng và recompile lại. Hãy backup SystemUI.apk phòng khi có lỗi!
Các hướng dẫn liên quan trên Appuals:
- Cách thủ công Theme Android System UI
- Cách Decompile và Theme Android APKs
- Cách Deodex APKs trên Stock ROM
Yêu cầu:
- Điện thoại Android đã root (Appuals có nhiều hướng dẫn root!)
- Công cụ decompile APK (khuyên dùng APK Easy Tool)
- Trình soạn thảo code tốt như Notepad++
Decompile SystemUI.apk
Đầu tiên deodex SystemUI.apk – dùng tool như Tickle My Android. Xem hướng dẫn deodex APK của Appuals.
Tiếp theo decompile SystemUI.apk, cần hướng dẫn riêng nếu chưa từng làm – may mắn Appuals có "Cách thủ công Theme Android System UI" kèm hướng dẫn decompile.
Thêm file SMALI
Bây giờ thêm file smali mới – có sẵn gói file .smali đã mod cho đúng mục đích TẠI ĐÂY. Cụ thể, giải nén file "SelfAnimatingImageView.smali" từ .zip, thêm vào thư mục decompile APK tại:
SystemUI.apk\smali\com\android\morningstar\
Tạo các thư mục nếu chưa có.
Tách GIF thành các frame
Tìm file .gif động bạn thích để làm phím Home. Nên dùng sticker gif (như trên Giphy.com/stickers) – có nền trong suốt như PNG nhưng thực chất là GIF.
Lưu sticker GIF, chuyển thành chuỗi PNG vì SystemUI mod không chạy native .gif, nó phát PNG lần lượt. Dùng công cụ online EZGIF Split.

Upload GIF vào EZGIF Split, chọn "Output images in PNG format" từ menu Split Options, tool sẽ tách các frame theo thứ tự. Tải về file ZIP chứa các frame.

Thêm các frame PNG vào thư mục drawable-xxxDPI phù hợp trong SystemUI decompile. Thư mục tùy DPI thiết bị:
- MDPI ≈ 160 DPI
- HDPI ≈ 240 DPI
- XHDPI ≈ 320 DPI
- XXHDPI ≈ 480 DPI
- XXXHDPI ≈ 640 DPI
Cần file XML chỉ dẫn Android dùng ảnh nào cho animation và tốc độ. Từ file ZIP trước lấy "frame_anim.xml", copy vào res\drawable trong APK decompile.
Mở frame_anim.xml trong Notepad++, nội dung như sau:
<?xml version="1.0" encoding="utf-8"?> <animation-list android:oneshot="false" xmlns:android="https://schemas.android.com/apk/res/android"> <item android:duration="100" android:drawable="@drawable/frame_0" /> <item android:duration="100" android:drawable="@drawable/frame_1" /> <item android:duration="100" android:drawable="@drawable/frame_2" /> <item android:duration="100" android:drawable="@drawable/frame_3" /> </animation-list>
Mỗi dòng <item đại diện frame theo thứ tự, thêm/bớt dòng tùy số frame GIF bạn tách.
Cuối cùng, gán animation lên navbar. Hơi phức tạp vì chỉnh file XML layout. Trên hầu hết stock ROM, code điều khiển phím Home navbar nằm trong layout\navigation_bar.xml, cũng có thể ở layout\home.xml. Tùy ROM mà tìm.
Tìm file XML layout chứa code giống sau:
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:id="@id/home_button" android:layout_width="0.0dip" android:layout_height="0.0dip" android:scaleType="center" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" />
Bạn biết đúng file khi thấy dòng tham chiếu home_button hoặc tương tự. Cần ẩn phím Home này, thay bằng phím mới cùng kích thước nhưng vô hình, animation frame sẽ nằm dưới. Dùng code FrameLayout:
<FrameLayout android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent"> <com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:src="@drawable/transparent" android:scaleType="center" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" /> <com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:id="@id/home_button" android:layout_width="0.0dip" android:layout_height="0.0dip" android:scaleType="center" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" /> <com.android.systemui.morningstar.SelfAnimatingImageView android:layout_gravity="center" android:id="@+id/frame_animation" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/frame_anim" /> </FrameLayout>
Code này xếp ba lớp lên nhau. Khi chạy, bạn chỉ thấy GIF động ở vị trí phím Home trên navbar.
Thay dòng code phím Home bằng FrameLayout ở trên, có thể cần tinh chỉnh cho ROM của bạn. Thử nghiệm một chút.
Recompile APK và Flash
Recompile APK đã mod bằng APK Easy Tool, flash trong recovery mode. Quan trọng: flash trong recovery để wipe Dalvik cache, nếu không file smali mới không được kích hoạt.
Nếu thành công, bạn sẽ thấy GIF động làm phím Home navbar mới!