Link tải các công cụ cần thiết và video hướng dẫn: https://www.mediafire.com/folder/d1qni9ledluob/ModKênh video hướng dẫn trên youtube: https://www.youtube.com/watch?v=fGkswBDiz6c&feature=share&list=PLkT5cA0IcjLMHQc4JDk2SQ_k4MhCgFbmzCác thứ cần chuẩn bị, mọi người download về và cài đặt nhé
1. Apktool: https://www.dropbox.com/s/xuw7qrojm6legxq/Apktool.zip
2. Jdk/java link tải: https://www.java.com/en/
3. Notepad++: https://download.tuxfamily.org/notepadplus/6.2.3/npp.6.2.3.Installer.exe
4. 7-Zip: https://www.7-zip.org/download.html
5. Cài app Root Explorer vào điện thoại, chấp nhận ứng dụng đc phép chạy trongSuperSU
6.File zip flash https://www.mediafire.com/download/9do0ny22j4p7yjc/flash+chuan+cho+kitkat.zip
B. TẠO FILE BACKUP TRƯỚC KHI MOD: (ví dụ file SystemUI.apk)
1. Hd dùng Root Explorer copy file SystemUI.apk ra ngoài : https://youtu.be/LdxAqAcoj38
2. Tạo file backup flash zip: https://youtu.be/FH2T1RQX2jw
3. Nếu mod bị lỗi, bạn vào recovery rồi install zip file backup này
C. CÁC BƯỚC TIẾN HÀNH:
- Chép Apktool.zip qua ổ C, giải nén được thư mục Apktool
- Trên điện thoại, vào đường dẫn System/framework copy file framework-res.apk vào thư mục khác trong bộ nhớ trong hoặc thẻ nhớ rồi copy vào thư mụcC:/Apktool
- Trên điện thoại, vào đường dẫn System/pri-app hoặc System/app copy file bạn cần làm (có thể là SystemUI.apk , SecSettings.apk, SamsungIME.apk...v.v.v) vào thư mục khác trong bộ nhớ trong hoặc thẻ nhớ rồi copy vào thư mục C:/Apktool
Hướng dẫn : https://youtu.be/IYWIUeSb0AU
I. Decompile:
- Vào cmd (Start -> Run -> Cmd)
- Gõ cd c:\apktool -> Enter
- Gõ tiếp: apktool if framework-res.apk
- Gõ : apktool if systemui.apk (ví dụ là file systemui.apk , nếu mod file khác thì đổi thành tên file khác)
- Gõ: apktool d systemui.apk (đợi giải nén)
- Làm theo các bước để mod ở dưới (II.MOD)
II. MOD
1. Mod sửa thông báo pin yếu:
a) Hướng dẫn bằng chữ:
- Decompile file SystemUI như hướng dẫn ở mục I.Decompile
- Ta được thư mục SystemUI (đường dẫn C:\apktool\systemui).
- Xong bạn vô thư mục C:\apktool\systemui\res\value-vi\strings.xml mở file strings.xml lên bằng Notepad++
Tìm đến những đoạn Code dưới rồi thay theo ý bạn:
Ví dụ mình thay:<string name="battery_low_title">Kết nối bộ sạc của bạn</string><string name="battery_low_subtitle">Pin đang yếu.</string><string name="battery_low_percent_format">%d%% còn lại</string><string name="battery_low_why">Dùng Pin</string><string name="low_battery_title">Pin yếu</string><string name="critical_low_battery_title">Pin rất yếu</string><string name="low_battery_text">Kết nối vào ổ cắm để sạc thiết bị...</string>
Sau đó save lại.<string name="battery_low_title">Chị Ruby Love ơi</string><string name="battery_low_subtitle">Em đói rồi dậy cho em ăn đi</string><string name="battery_low_percent_format">%d%% thể lực</string><string name="battery_low_why">Kệ mẹ em</string><string name="low_battery_title">Chị Ruby Love ơi</string><string name="critical_low_battery_title">Em sắp die rồi</string><string name="low_battery_text">Dậy cho em ăn đi</string>
- Copy file hình muốn hiển thị khi thông báo vào C:\apktool\systemui\res\drawable-xxhdpi
Lưu ý: file hình phải đổi tên thành : battery_low_battery.png (định dạng png)
- Recompile và Sign apk (xem ở mục III.Recompile và Sign Apk bên dưới )
- Copy file SystemUI đã build được vào điện thoại đúng thư mục system/priv-app và set 6-4-4
HoặcTạo file zip flash rồi copy vào điện thoại (xem mục IV. Tạo file zip flash hoặc
video: https://youtu.be/Ftm68mt4eHY )
- Vào recovery flash file zip vừa tạo -> Xong
b) Video hướng dẫn: https://youtu.be/MdfDfcb20Yo
2. Thay chữ xóa ở nofitication thành chữ khác:
- Decompile file SystemUI như hướng dẫn ở mục I.Decompile.
- Tìm đến C:\Apktool\SystemUI\res\layout\status_bar.xml mở file status_bar.xml lên bằng Notepad++
- Xóa dòng:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />- Thêm đoạn code này:
- Vào dưới dòng này:<LinearLayout android:gravity="center" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"><com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ff5cb8ff" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" /></LinearLayout>
- Save lại.com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0"><TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" /><TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" /></com.android.systemui.statusbar.phone.TickerView></LinearLayout>
- Recompile và Sign Apk (xem cách Recompile và Sign apk ở mục III.Recompile, Sign apk bên dưới).
- Tạo file zip flash.
3. Mod đồng hồ ra giữa:
4. Mod đổi màu đồng hồ:
- Decompile file SystemUI như hướng dẫn ở mục I.Decompile. (nếu trong C:\apktool đã có thư mục systemui thì phải xóa đi)
- Tìm đến C:\Apktool\SystemUI\res\layout\status_bar.xml
- Tìm dòng:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:textColor="#ffffffff" android:gravity="center" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />- Đổi #ffffffff thành mã màu mà bạn muốn ( có thể lấy mã màu ở https://haylem.net/tienich/mamau.html)
- Save lại.
- Recompile và Sign Apk.
5. Mod lock home ẩn: (chạm vào góc phải vị trí đồng hồ sẽ tắt màn hình)
- Decompile SystemUI.apk
- Download 2 file này về
https://www.mediafire.com/?91rj9anq3bj2pr8
cho vào C:\apktool/systemui/res/drawable-xxhdpi/
- Recompile và sign apk
- Copy file systemui.apk trong thư mục C:\apktool\systemui\dist ra ngoài C:\apktool\ và xóa thư mục C:\apktool\systemui\
- Decomplie file systemui.apk mới này
- Sau đó vào C:/apktool/systemui/res/layout/status_bar.xml mở file status_bar.xml lên sửa
- Copy code này vào vị trí như hình
- Save lại.<LinearLayout android:gravity="left" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/home" android:paddingRight="0.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/vnhome" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:glowBackground="@drawable/ic_sysbar_highlight" /> </LinearLayout> <LinearLayout android:gravity="right" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="0.0dip" android:src="@drawable/vnlock" android:singleLine="true" android:layout_toRightOf="@id/recent_apps" android:layout_alignParentLeft="true" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:glowBackground="@drawable/ic_sysbar_highlight" /> </LinearLayout>
- Xong Recomplie và sign apk
Video hướng dẫn: https://youtu.be/DAYEBCcHbcw
6. Add app hay dùng vào Notification:
- Decomplie SystemUI.apk
- Download file này về, giải nén chọn hệ điều hành của PC bạn đang dùng copy hết vào theo đường dẫn SystemUI/smali/com/android/systemui/statusbar/policy/
- Mở file SystemUI/res/layout/status_bar_expanded.xml
- Thêm code vào như hình:
<HorizontalScrollView android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="wrap_content"><com.android.systemui.statusbar.policy.quicklaunch.QuickLaunchContainer android:gravity="center" android:layout_width="wrap_content" android:layout_height="fill_parent" /></HorizontalScrollView>
- Recompile và sign apk
Video hướng dẫn: https://youtu.be/fGkswBDiz6c
7. Mod các phím tắt vào notification:
- Decompile SystemUI.apk
- Download file, giải nén và copy hình vào thư mục C:\apktool\systemui\res\drawable-xxhdpi
https://www.mediafire.com/download/vtyz5pj4b7zrbo7/hinh.rar
- Recompile thư mục SystemUI và Sign apk (xem hướng dẫn ở mục III. Cách Recompile và sign apk)
- Recompile lần nữa.
- Copy file systemui.apk vừa build đc (trog thư mục C:\apktool\systemui\dist) dán vào C:\apktool và xóa thư mục SystemUI (C:\apktool\systemui\)
- Decompile file systemui.apk mới đó
- Mở file status_bar_expanded.xml trong mục SystemUI\res\layout
- Copy code này
- Đặt dưới code này:<LinearLayout android:orientation="horizontal" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false"> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/recent_apps" android:background="@drawable/vn_ic_task" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/settings_button" android:contentDescription="@string/accessibility_recent" systemui:keyCode="187" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:background="@drawable/vn_ic_calllog" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="5" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:background="@drawable/vn_ic_music" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="79" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:background="@drawable/vn_ic_music_1" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="25" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:background="@drawable/vn_ic_music_2" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="24" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@id/back" android:background="@drawable/vn_ic_lock" android:paddingRight="60.0dip" android:layout_width="60.0dip" android:layout_height="60.0dip" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_back" systemui:keyCode="26" systemui:keyRepeat="false" systemui:glowBackground="@drawable/vn_ic_btn_press" /> </LinearLayout>
<View android:background="@color/toggle_slider_divider_color"
- Tiếp theo bạn vào SystemUI\res\values mở file public.xml
Tìm đến cuối đoạn drawable, tìm xem có vn_ic_task không nếu có thì ok rồi
- Recompile thư mục SystemUI và Sign Apk (hướng dẫn ở mục III. Cách Recompile và sign apk)
- Recompile lần nữa
*Tóm tắt cách làm:
Bước 1: Decompile -> bỏ hình vào -> Recompile -> Sign Apk -> Recompile lần nữaVideo hướng dẫn: https://youtu.be/KmsaC7FG32A
Bước 2: Decompile file mới build đc ở Bước 1 -> Sửa code -> Recompile -> Sign Apk -> Recompile lần nữa
Bước 3: Đóng gói file zip flash
8. Mod bàn phím:
SamsungIME.apk nằm trong thư mục system/app
Hướng dẫn: Decompile SamsungIME.apk -> sửa code -> Recompile -> Sign apk -> Recompile lần nữa
* Mod dpi ( mod icon to hay nhỏ tuỳ bạn )
- SamsungIME/res/values-sw359dp-xhdpi/dimens.xml
- Tương tự làm với SamsungIME/res/values-sw359dp-land-xhdpi/dimens.xml
để mod keyboard khi quay ngang màn hình nhé.
* Mod bỏ ký tự thừa như ký tự mình khoanh đỏ phía trên ảnh đầu.
- SamsungIME/res/xml/qwerty_vi.xml
tìm
<Key android:horizontalGap="@dimen/qwerty_first_col_horizontal_gap" android:codes="97" android:popupCharacters="ăâ" android:keyEdgeFlags="left" android:keyLabel="a" /> <Key android:codes="115" android:popupCharacters="" android:keyLabel="s" /> <Key android:codes="100" android:popupCharacters="đ" android:keyLabel="d" /> <Key android:codes="102" android:popupCharacters="" android:keyLabel="f" /> <Key android:codes="103" android:popupCharacters="" android:keyLabel="g" /> <Key android:codes="104" android:popupCharacters="" android:keyLabel="h" /> <Key android:codes="106" android:popupCharacters="" android:keyLabel="j" /> <Key android:codes="107" android:popupCharacters="" android:keyLabel="k" /> <Key android:codes="108" android:popupCharacters="" android:keyLabel="l" /> <Key android:codes="-769" android:popupKeyboard="@xml/popup_template_keyboard" android:popupCharacters="@string/vietnamese_tone" android:keyEdgeFlags="right" android:keyIcon="@drawable/qwerty_vietnam_p_01" />
Thay bằng
<Key android:horizontalGap="@dimen/qwerty_first_col_horizontal_gap_second_line" android:codes="97" android:popupCharacters="ăâ" android:keyEdgeFlags="left" android:keyLabel="a" /> <Key android:codes="115" android:popupCharacters="" android:keyLabel="s" /> <Key android:codes="100" android:popupCharacters="đ" android:keyLabel="d" /> <Key android:codes="102" android:popupCharacters="" android:keyLabel="f" /> <Key android:codes="103" android:popupCharacters="" android:keyLabel="g" /> <Key android:codes="104" android:popupCharacters="" android:keyLabel="h" /> <Key android:codes="106" android:popupCharacters="" android:keyLabel="j" /> <Key android:codes="107" android:popupCharacters="" android:keyLabel="k" /> <Key android:codes="108" android:popupCharacters="" android:keyEdgeFlags="right" android:keyLabel="l" />
- Làm tương tự với các file
+ SamsungIME/res/xml-sw359dp-xhdpi/qwerty_vi.xml
+ SamsungIME/res/xml-sw359dp-land-xxhdpi/qwerty_vi.xml
Video hướng dẫn: https://youtu.be/kYowCE3XoP0
9. Mod Setting mang giao diện giống S5 ( Chỉ dành cho 4.4):
- Decompile file SecSettings.apk (file SecSettings.apk nằm trong System/pri-app)
- Mở file bools.xml SecSettings.apk\res\values\bools.xml
- Sửa code :
Trước: <bool name="settings_grid">false</bool>
Sau : <bool name="settings_grid">true</bool>Để tránh xuất hiện 2 icon setting trong launcher. xóa 1 thằng trong AndroidManifest.xml này đi
<category android:name="android.intent.category.LAUNCHER" />
10. Mod Quicksettings Note 3 thành S5
Dùng app Root Explorer mở file build.prop (nằm trong thư mục System) -> Open in Text Editor -> Sửa như hình hướng dẫn
III. Cách Recompile và sign apk:
Recompile:
- Bật cmd lên gõ apktool b systemui
Sign apk:
- Vào C:\apktool mở file SystemUI.apk gốc bằng cách nhấp chuột phải vào file SystemUI.apk gốc , chọn 7-zip -> Open Archive
- Copy 2 file META-INF + AndroidManifest.xml chép đè vào thư mục C:\apktool\SystemUI\build\apk
- Xong vào lại cmd gõ apktool b systemUI tức là Recompile lại 1 lần nữa
- Sau đó vào C:\apktool\systemui\dist , đổi tên thành SystemUI.apk )
IV. Tạo file zip flash (kitkat 4.4.2)
Download file flash zip mẫu: https://www.dropbox.com/s/lg2exie7i2u6b21/flash.zip
Video hướng dẫn: https://www.youtube.com/watch?v=Ftm68mt4eHY
Nguồn tài liệu: Topic của thanhfhuongf và nhiều nguồn trên internet: https://www.tinhte.vn/threads/samsung-android-development-cac-buoc-mod-va-cook-rom-co-ban.2247908/
Sưu tầm và viết lại: Ruby Love