MỘT SỐ THỦ THUẬT VỚI SYSTEMUI VÀ FRAMEWORK

Hôm nay mình xin mạn phép hướng dẫn một số bạn chưa biết về những thủ thuật mod với systemui và framework
(đặc biệt là dòng máy của samsung, còn của hãng khác mình chưa thử bao giờ)
Bài này mình có sử dụng tài liệu từ bác bác Vinhvinh305, bác thanhfhuongf và bác kurom cùng 1 số bài khác bên xda

Để tạo file systemui mang phong cách riêng của các bạn thì có một vấn đề cơ bản là các bạn phải biết decompile và recompile
Chi tiết về decompile và recompile thì các bạn xem ở đây:
http://www.tinhte.vn/threads/samsun...r-center-clock-transparent-statusbar.2012376/
( khuyến khích các bác làm xong dc mod home+lọck thì mới làm những cái mod dưới để dễ thao tác hơn)

1 số công cụ:
Jdk/java link tải: http://www.java.com/en/ (nếu có sẵn java trong máy rồi thì thôi)
Apktoolhttp://www.mediafire.com/download.php?qza7uquol5fugto(giải nén file apktool.zip và copy cả thư mục apktool chứ 3 file vào ổ đĩa C):)
notepad ++http://download.tuxfamily.org/notepadplus/6.2.3/npp.6.2.3.Installer.exe
Winrar hoặc 7zip (để nén, giải nén): đầy trên net
* Chú ý nhỏ: để tìm code các bạn dùng tổ hợp phím Ctrl+F cho nhanh

1. Mod transparent noti


- đầu tiên các bác decompile file systemui. apk giống như link bên trên đã hướng dẫn
- sau khi decompile thành công và tiến hành chỉnh sửa Systemui đã bung.
a.vào res/layouts
tw_status_bar_expanded.xml
tìm Code:
Code:
android:background="#something"


trong xml đổi code "#something" thành "#00000000".
chú ý : 
+ cứ tìm cái background=#............" đổi hết như trên.
+ Riêng cái này ko cần đổi nhé
android:background="@drawable/notification_panel_bg"
b. vào SystemUI\smali\com\android\systemui\statusbar\phone
tìm PhoneStatusBar.smali
- find -0x100 (có 2 chỗ như thế này nhé. phải đổi cả 2) ( dùng tính năng seach trong notepad++ cho nhanh. search 2 lần ra 2 chỗ. chứ tìm lòi hết cả mắt ko thấy đâu. nó nhiều lắm)
- change both to 0x0 (0=zero)
- save smali.
XONG. recompile lại là Ok.
- giờ mới thay hình nền notification_panel_bg.9.png trong suốt vào( tuỳ bạn thik thay hình j thì thay) NHỚ ĐỪNG THAY HÌNH NỀN NÀY TRƯỚC KHI DECOMPILE DỄ GÂY LỖI 9PATCH LẮM. 
- thay tiếp tw_quick_panel_quick_setting_button_bg_normal.9.png trong suốt để làm trong suốt phần toggle button background.
giờ thì xong rồi. chúc các bạn may mắn.

2. Mod trong suốt All rom 
[IMG]
[IMG]

1. decompile framework-res.apk
2. vào framework-res.apk/res/drawable-nodpi chỉnh sửa 2 file background_holo_dark.png và tw_background_holo_dark.png thành trong suốt
3. vào framework-res.apk/res/values/style.xml mở file style.xml lên

Tìm dòng code sau: 

Code:
<style name="Theme.Holo" parent="@style/Theme">
kéo xuống tìm đoạn code này:


Code:
<item name="windowShowWallpaper">false</item>
thay đổi thành thế này


Code:
<item name="windowShowWallpaper">true</item>
Tìm tiếp dòng code sau: 


Code:
<style name="Theme.Holo.InputMethod" parent="@style/Theme.Holo.Light.Panel">
thêm dòng này dưới nó

Code:
<item name="windowShowWallpaper">false</item>
Tìm tiếp dòng code sau: 


Code:
<style name="Theme.Holo.Dialog" parent="@style/Theme.Holo">
thêm dòng này dưới nó


Code:
<item name="windowShowWallpaper">false</item>
Tìm tiếp dòng code sau: 


Code:
<style name="Theme.DeviceDefault.InputMethod" parent="@style/Theme.DeviceDefault">
thêm dòng này dưới nó


Code:
<item name="windowShowWallpaper">false</item>
4. save và compile

3. Đổi màu chữ ở stt 
1. decompile file systemui
2. đổi màu chữ ở stt:
tìm đến res/layout mở file tw_status bar.xml 
+ đổi màu chỉ thị pin:
Code:
<TextView android:textSize="12.0dip" android:textColor="#something"
+ đổi màu đồng hồ:
Code:
 <com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#something"
các bác đổi cái something ở cuối dòng code đó thành màu các bác muốn
bảng mã hex của các màu các bác xem ở đây và thay vào:http://vntim.blogspot.com/2009/06/bang-ma-mau-code-color.html

3. đổi màu chữ ở noti
mở file tw_status_bar_expanded_header.xml 
+ cho pull down clock
[IMG]

Code:
<com.android.systemui.statusbar.policy.Clock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="#something"
+ cho ngày:
Code:
"@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="#something"
4. save và compile

4. Đổi chỗ các toggle
trc
[IMG]

sau
[IMG]

1. decompile systemui. xong vào res/values mở arrays.xml
2. tìm code
Code:
<string-array name="QuickSettingButtonAttribute">
        <item>Wifi</item>
<item><string-array name="QuickSettingButtonAttribute">
        <item>Wifi</item>
    <item>Location</item>
        <item>SilentMode</item>
        <item>AutoRotate</item>
        <item>Bluetooth</item>
        <item>MobileData</item>
        <item>DormantMode</item>
        <item>PowerSaving</item>
        <item>AllShareCast</item>
        <item>MultiWindow</item>
    <item>Sync</item>
    </string-array>
3. di chuyển vị trí theo ý bạn, sau đây là ví dụ
Code:
<string-array name="QuickSettingButtonAttribute">
        <item>Wifi</item>
        <item>SilentMode</item>
        <item>AutoRotate</item>
        <item>Bluetooth</item>
        <item>MobileData</item>
        <item>DormantMode</item>
        <item>PowerSaving</item>
        <item>AllShareCast</item>
        <item>MultiWindow</item>
    <item>Location</item>
        <item>Sync</item>
    </string-array>
4. save và compile

5. Xóa BRIGHTNESS BAR
[IMG]
1. decompile systemui
2. vào res/layouts mở tw_status_bar_expanded.xml
3. tìm code
Code:
<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller" android:background="#00000000" android:layout_width="fill_parent" android:layout_height="56.0dip">
4. thay cái này
Code:
android:layout_height="56.0dip"
bằng
Code:
android:layout_height="0.0dip"
5. save và compile

6. Mod transparent stt
1. decompile systemui
2. vào res/layouts mở tw_status_bar.xml
3. tìm code(nó ở dòng đầu tiên thì phải)
Code:
<item type="drawable" name="status_bar_background">#something</item>
4. đổi something thành 00000000 nếu bạn muốn trong suốt 100%
3f000000 nếu muốn trong suốt 75%
7f000000 nếu muốn trong suốt 50%
5. save và compile


7. Mod thanh toggle xuống dưới cùng
[IMG] 

+ decompile SystemUI.apk và tìm đến /res/layout/tw_status_bar_expanded
+ tìm đến code và di chuyển (move) nó
Code:
<include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
        <TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
        <View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />
+ paste cái code trên vào giữa code này:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/scrollCart"...........
và code này:
Code:
<LinearLayout android:orientation="vertical" android:id="@id/brightness_controller"...................
+sau đó ở trước code này:
Code:
<com.android.systemui.statusbar.phone.CloseDragHandle....
tạo 1 LinearLayout , bạn sẽ dc như này:
Code:
<LinearLayout android:layout_gravity="bottom" android:orientation="vertical" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="80.0dip" android:layout_marginBottom="32.5dip">
        <HorizontalScrollView android:id="@id/quicksetting_scroller" android:visibility="gone" android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="0.0dip" android:overScrollMode="never">
            <com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="#00000000" android:showDividers="middle" />
        </HorizontalScrollView>
    </LinearLayout>
+ Chú ý: nếu bạn dùng 23 toggle thì chỉ cần thêm code này thôi
Code:
 <LinearLayout android:layout_gravity="bottom" android:orientation="vertical" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="80.0dip" android:layout_marginBottom="32.5dip">
        <HorizontalScrollView android:id="@id/quicksetting_scroller" android:visibility="gone" android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="0.0dip" android:overScrollMode="never">
            <com.android.systemui.statusbar.policy.quicksetting.QuickSettingPanel android:orientation="horizontal" android:id="@id/quicksetting_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:divider="#00000000" android:showDividers="middle" />
        </HorizontalScrollView>
        <com.wanam.systemui.quickpanel.PowerWidget android:id="@id/exp_power_stat" android:layout_width="wrap_content" android:layout_height="75.0dip" />
    </LinearLayout>
+ save và compile


Sau khi mod xong các file của mình các bạn có thể dùng root explore để di chuyển vào chỗ cũ hoặc tạo một file zip để flash qua cwm
Cách tạo file zip để flash qua cwm(dành cho máy nào có cwm tạm rồi nhé)
- down load
+ template: http://www.mediafire.com/download/jaesjq5sof46i9p/Template-for-auto-perm-fix-kernel_v1.1.zip
- mở template bằng winrar hoặc 7zip, mở chứ k giải nén nhé
- tìm đến preload/symlink/system/app 

- kéo thả file mà bạn muốn flash qua cwm vào đó
- copy file zip vào thẻ nhớ r vào cwm mà flash thôi :D
Theo tinhte.vn

Đăng nhận xét