原帖地址:

http://bbs.mfunz.com/forum.php?mod=viewthread&tid=235198&extra=page%3D1%26filter%3Dtypeid%26typeid%3D899%26typeid%3D899

反编译、重编译这是基本功

要修改的APK: system/app/SystemUI.apk

第一部分 ----简单自定义

反编译后用Notepad++打开res/layout/lonyii_quick_settings.xml,

小猪版的打开res/layout/xiaozhu_zhu_settings.xml,

节选三个按钮的布局代码:

第一段:WIFI,看<FrameLayout android:id=”@id/lonyii_wifi_btn”这句,,id=xxxxxwifixxxxx

  1. <FrameLayout android:id=”@id/lonyii_wifi_btn” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:layout_weight=”1.0″>

  2. <ImageView android:layout_gravity=”center_horizontal” android:id=”@id/lonyii_wifi_btn_icon” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”2.669983dip” android:src=”@drawable/akt_lonyii_icon_wifi_off” />

  3. <com.android.systemui.statusbar.lonyii.WifiSettingButton android:textSize=”1.0dip” android:textStyle=”normal” android:textColor=”#ffffffff” android:gravity=”center_horizontal” android:id=”@id/lonyii_wifi_btn_text” android:paddingTop=”0.0dip” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:text=”@string/lonyii_wifi_text” android:shadowDx=”1.0″ android:shadowDy=”1.0″ />

  4. <ImageView android:layout_gravity=”bottom|center” android:id=”@id/lonyii_wifi_btn_status_icon” android:paddingLeft=”0.0dip” android:paddingRight=”0.0dip” android:layout_width=”fill_parent” android:layout_height=”8.0dip” android:layout_marginBottom=”0.0dip” android:src=”@drawable/akt_lonyii_icon_off” android:scaleType=”fitXY” />

  5. </FrameLayout>

第二段:蓝牙,<FrameLayout android:id=”@id/lonyii_bt_btn”     ------->bt=bluetooth

  1. <FrameLayout android:id=”@id/lonyii_bt_btn” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:layout_weight=”1.0″ android:layout_toRightOf=”@id/lonyii_wifi_btn”>

  2. <ImageView android:layout_gravity=”center_horizontal” android:id=”@id/lonyii_bt_btn_icon” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”2.669983dip” android:src=”@drawable/akt_lonyii_icon_bluetooth_off” />

  3. <com.android.systemui.statusbar.lonyii.BluetoothSettingButton android:textSize=”1.0dip” android:textStyle=”normal” android:textColor=”#ffffffff” android:gravity=”center_horizontal” android:id=”@id/lonyii_bt_btn_text” android:paddingTop=”0.0dip” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:text=”@string/lonyii_bluetooth_text” android:shadowDx=”1.0″ android:shadowDy=”1.0″ />

  4. <ImageView android:layout_gravity=”bottom|center” android:id=”@id/lonyii_bt_btn_status_icon” android:paddingLeft=”0.0dip” android:paddingRight=”0.0dip” android:layout_width=”fill_parent” android:layout_height=”8.0dip” android:layout_marginBottom=”0.0dip” android:src=”@drawable/akt_lonyii_icon_off” android:scaleType=”fitXY” />

  5. </FrameLayout>

复制代码

第三段:GPS

  1. <FrameLayout android:id="@id/lonyii_gps_btn" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_toRightOf="@id/lonyii_bt_btn">

  2. <ImageView android:layout_gravity="center_horizontal" android:id="@id/lonyii_gps_btn_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="2.669983dip" android:src="@drawable/akt_lonyii_icon_gps_off" />

  3. <com.android.systemui.statusbar.lonyii.GpsSettingButton android:textSize="1.0dip" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center_horizontal" android:id="@id/lonyii_gps_btn_text" android:paddingTop="0.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/lonyii_gps_text" android:shadowDx="1.0" android:shadowDy="1.0" />

  4. <ImageView android:layout_gravity="bottom|center" android:id="@id/lonyii_gps_btn_status_icon" android:paddingLeft="0.0dip" android:paddingRight="0.0dip" android:layout_width="fill_parent" android:layout_height="8.0dip" android:layout_marginBottom="0.0dip" android:src="@drawable/akt_lonyii_icon_off" android:scaleType="fitXY" />

  5. </FrameLayout>

复制代码

记住3点就行:

1.从<FrameLayout>到</FrameLayout>是一个按钮的布局代码;

2.<FrameLayout>里面的属性 android:id="@id/lonyii_gps_btn" 表示 这是一个什么按钮,这条就是指GPS;

3.<FrameLayout>里面的另一个属性android:layout_toRightOf表示这个按钮在哪个按钮的右边,android:layout_toRightOf="@id/lonyii_bt_btn"就是表示其在蓝牙按钮的右边,调换顺序及删除按钮的时候要注意修改成对应的ID。

.删除某个按扭

1.先删除某个按钮的代码块,即从<FrameLayout>到</FrameLayout>

2.修改已删除按钮右侧的android:layout_toRightOf按钮属性,比如删除了蓝牙按钮,就得修改它右侧的,即GPS,把这句android:layout_toRightOf="@id/lonyii_bt_btn"改成android:layout_toRightOf="@id/lonyii_wifi_btn",因为你删除了蓝牙,GPS左侧按钮就应该是WIFI了,

.调换按钮顺序

1.直接修改android:layout_toRightOf属性就行,最好也能换一下按钮代码块的顺序,以便自己阅读,不然到时自己都凌乱了,

2.比如把GPS和蓝牙互换,蓝牙代码块的android:layout_toRightOf="@id/lonyii_wifi_btn"属性就要改成android:layout_toRightOf="@id/lonyii_gps_btn",因为互换后其在GPS右侧了;GPS代码块的android:layout_toRightOf="@id/lonyii_bt_btn"就要改成android:layout_toRightOf="@id/lonyii_wifi_btn",因为互换后GPS是在WIFI右侧。

.替换图片
不用反编译,用WINRAR打开SystemUI.apk,找到对应的按钮图片,弄个自己喜欢的图片替换压缩进去再弄进手机就可以了

第二部分 ----通知栏添加快捷按钮的思路

其实思路很简单的,把相关的东西提取出来就OK了,具体分为四大块:

1.相关图片

2.smali代码文件夹

3.布局文件

4.获取public.xml里面的新ID后修改SMALI里面关联的资源ID

下面以LONYII版本为例,

提取的思路是

反编译SystemUI.apk

因为要在通知栏加东西,必然要修改通知栏的布局文件即status_bar_expanded.xml

打开status_bar_expanded.xml即可找到快捷按钮的关键句<include layout="@layout/lonyii_quick_settings" />,就是说在这个地方包含/插入lonyii_quick_settings.xml这个布局文件

再转到lonyii_quick_settings.xml就可以看到这个代码块<com.android.systemui.statusbar.lonyii.QuickSettingsView>,即调用smali/com/android/systemui/statusbar/lonyii/quicksettingsview.smali这个程序

不难发现存在如下文件夹  ----lonyii

这个lonyii目录就正是我们要提取的第2块,快捷面板的主程序都在这里了

直接整个文件夹复制吧,备用

-------------------------------------------------------

下一步就是提取图片了,图片文件在SystemUI\res\drawable-hdpi,快捷面板的图片文件名都很有规律的,不管是CM7版还是ArgenSoft(LONYII及小猪版就是从此提取)都很规律,以LONYII版为例,要提取的有以下文件:

  1. akt_lonyii_icon_bluetooth_ing.png

  2. akt_lonyii_icon_bluetooth_off.png

  3. akt_lonyii_icon_bluetooth_on.png

  4. akt_lonyii_icon_brightness_off.png

  5. akt_lonyii_icon_brightness_on.png

  6. akt_lonyii_icon_gps_off.png

  7. akt_lonyii_icon_gps_on.png

  8. akt_lonyii_icon_ing.png

  9. akt_lonyii_icon_mobile_data_off.png

  10. akt_lonyii_icon_mobile_data_on.png

  11. akt_lonyii_icon_off.png

  12. akt_lonyii_icon_on.png

  13. akt_lonyii_icon_rotation_off.png

  14. akt_lonyii_icon_rotation_on.png

  15. akt_lonyii_icon_silent_off.png

  16. akt_lonyii_icon_sound_on_on.png

  17. akt_lonyii_icon_sound_vibration_on.png

  18. akt_lonyii_icon_vibration_off.png

  19. akt_lonyii_icon_wifi_ing.png

  20. akt_lonyii_icon_wifi_off.png

  21. akt_lonyii_icon_wifi_on.png

  22. akt_lonyii_quick_settings_background.png

  23. akt_lonyii_title_background.9.png

  24. akt_quick_panel_icon_flight_mode_off.png

  25. akt_quick_panel_icon_flight_mode_on.png

  26. akt_quick_panel_icon_sync_mode_off.png

  27. akt_quick_panel_icon_sync_mode_on.png

  28. lonyii_icon_shutdown.png

复制出来,备用,图片部分搞定

-------------------------------------------------------

接下来就是XML部分的提取,有strings、ids和layout三部分,要提取哪些可以看public.xml里面有哪些相关的东西,过滤了一下可以看到关于快捷面板的有以下东西:

:书签1

  1. <public type="drawable" name="akt_lonyii_icon_bluetooth_ing" id="0x7f0200e5" />

  2. <public type="drawable" name="akt_lonyii_icon_bluetooth_off" id="0x7f0200e6" />

  3. <public type="drawable" name="akt_lonyii_icon_bluetooth_on" id="0x7f0200e7" />

  4. <public type="drawable" name="akt_lonyii_icon_gps_off" id="0x7f0200e8" />

  5. <public type="drawable" name="akt_lonyii_icon_gps_on" id="0x7f0200e9" />

  6. <public type="drawable" name="akt_lonyii_icon_ing" id="0x7f0200ea" />

  7. <public type="drawable" name="akt_lonyii_icon_mobile_data_off" id="0x7f0200eb" />

  8. <public type="drawable" name="akt_lonyii_icon_mobile_data_on" id="0x7f0200ec" />

  9. <public type="drawable" name="akt_lonyii_icon_off" id="0x7f0200ed" />

  10. <public type="drawable" name="akt_lonyii_icon_on" id="0x7f0200ee" />

  11. <public type="drawable" name="akt_lonyii_icon_rotation_off" id="0x7f0200ef" />

  12. <public type="drawable" name="akt_lonyii_icon_rotation_on" id="0x7f0200f0" />

  13. <public type="drawable" name="akt_lonyii_icon_silent_off" id="0x7f0200f1" />

  14. <public type="drawable" name="akt_lonyii_icon_sound_on_on" id="0x7f0200f2" />

  15. <public type="drawable" name="akt_lonyii_icon_sound_vibration_on" id="0x7f0200f3" />

  16. <public type="drawable" name="akt_lonyii_icon_vibration_off" id="0x7f0200f4" />

  17. <public type="drawable" name="akt_lonyii_icon_wifi_ing" id="0x7f0200f5" />

  18. <public type="drawable" name="akt_lonyii_icon_wifi_off" id="0x7f0200f6" />

  19. <public type="drawable" name="akt_lonyii_icon_wifi_on" id="0x7f0200f7" />

  20. <public type="drawable" name="akt_lonyii_quick_settings_background" id="0x7f0200f8" />

  21. <public type="drawable" name="akt_lonyii_title_background" id="0x7f0200f9" />

  22. <public type="drawable" name="akt_quick_panel_icon_flight_mode_off" id="0x7f0200fa" />

  23. <public type="drawable" name="akt_quick_panel_icon_flight_mode_on" id="0x7f0200fb" />

  24. <public type="drawable" name="akt_quick_panel_icon_sync_mode_off" id="0x7f0200fc" />

  25. <public type="drawable" name="akt_quick_panel_icon_sync_mode_on" id="0x7f0200fd" />

  26. <public type="drawable" name="akt_lonyii_icon_brightness_off" id="0x7f0200fe" />

  27. <public type="drawable" name="akt_lonyii_icon_brightness_on" id="0x7f0200ff" />

  28. <public type="drawable" name="lonyii_icon_shutdown" id="0x7f020100" />

  29. <public type="layout" name="lonyii_gps_alertdialog" id="0x7f030007" />

  30. <public type="layout" name="lonyii_mobiledata_alertdialog" id="0x7f030008" />

  31. <public type="layout" name="lonyii_mobiledata_offdialog" id="0x7f030009" />

  32. <public type="layout" name="lonyii_quick_settings" id="0x7f03000a" />

  33. <public type="string" name="lonyii_wifi_text" id="0x7f070011" />

  34. <public type="string" name="lonyii_bluetooth_text" id="0x7f070012" />

  35. <public type="string" name="lonyii_gps_text" id="0x7f070013" />

  36. <public type="string" name="lonyii_mobiledata_text" id="0x7f070014" />

  37. <public type="string" name="lonyii_sound_vibration_text" id="0x7f070015" />

  38. <public type="string" name="lonyii_silent_text" id="0x7f070016" />

  39. <public type="string" name="lonyii_vibration_text" id="0x7f070017" />

  40. <public type="string" name="lonyii_rotation_text" id="0x7f070018" />

  41. <public type="string" name="lonyii_error_text" id="0x7f070019" />

  42. <public type="string" name="lonyii_sound_text" id="0x7f07001a" />

  43. <public type="string" name="location_3rdparty_gps_dialogtext" id="0x7f07001b" />

  44. <public type="string" name="mobiledata_dialogtext" id="0x7f07001c" />

  45. <public type="string" name="warning_alert_check" id="0x7f07001d" />

  46. <public type="string" name="mobiledataconnection_dialogtext" id="0x7f07001e" />

  47. <public type="string" name="location_title" id="0x7f07001f" />

  48. <public type="string" name="mobiledata_title" id="0x7f070020" />

  49. <public type="string" name="mobiledata_connect" id="0x7f070021" />

  50. <public type="string" name="mobiledataconnection_title" id="0x7f070022" />

  51. <public type="string" name="agree" id="0x7f070023" />

  52. <public type="string" name="lonyii_flight_text" id="0x7f070024" />

  53. <public type="string" name="lonyii_sync_text" id="0x7f070025" />

  54. <public type="string" name="lonyii_brightness_text" id="0x7f070026" />

  55. <public type="string" name="shutdown_confirm" id="0x7f070027" />

  56. <public type="string" name="lonyii_shutdown_text" id="0x7f070028" />

  57. <public type="string" name="hamster" id="0x7f070029" />

  58. <public type="id" name="lonyii_quick_settings" id="0x7f09001c" />

  59. <public type="id" name="lonyii_wifi_btn_icon" id="0x7f09001d" />

  60. <public type="id" name="lonyii_wifi_btn_text" id="0x7f09001e" />

  61. <public type="id" name="lonyii_wifi_btn_status_icon" id="0x7f09001f" />

  62. <public type="id" name="lonyii_bt_btn_icon" id="0x7f090020" />

  63. <public type="id" name="lonyii_bt_btn_text" id="0x7f090021" />

  64. <public type="id" name="lonyii_bt_btn_status_icon" id="0x7f090022" />

  65. <public type="id" name="lonyii_gps_btn_icon" id="0x7f090023" />

  66. <public type="id" name="lonyii_gps_btn_text" id="0x7f090024" />

  67. <public type="id" name="lonyii_gps_btn_status_icon" id="0x7f090025" />

  68. <public type="id" name="lonyii_mobiledata_btn_icon" id="0x7f090026" />

  69. <public type="id" name="lonyii_mobiledata_btn_text" id="0x7f090027" />

  70. <public type="id" name="lonyii_mobiledata_btn_status_icon" id="0x7f090028" />

  71. <public type="id" name="lonyii_rotation_btn_icon" id="0x7f090029" />

  72. <public type="id" name="lonyii_rotation_btn_text" id="0x7f09002a" />

  73. <public type="id" name="lonyii_rotation_btn_status_icon" id="0x7f09002b" />

  74. <public type="id" name="lonyii_sound_btn_icon" id="0x7f09002c" />

  75. <public type="id" name="lonyii_sound_btn_text" id="0x7f09002d" />

  76. <public type="id" name="lonyii_sound_btn_status_icon" id="0x7f09002e" />

  77. <public type="id" name="gps_Text" id="0x7f09002f" />

  78. <public type="id" name="mobiledata_text" id="0x7f090030" />

  79. <public type="id" name="mobiledata_checkbox" id="0x7f090031" />

  80. <public type="id" name="lonyii_flight_btn_icon" id="0x7f090032" />

  81. <public type="id" name="lonyii_flight_btn_text" id="0x7f090033" />

  82. <public type="id" name="lonyii_flight_btn_status_icon" id="0x7f090034" />

  83. <public type="id" name="lonyii_sync_btn_icon" id="0x7f090035" />

  84. <public type="id" name="lonyii_sync_btn_text" id="0x7f090036" />

  85. <public type="id" name="lonyii_sync_btn_status_icon" id="0x7f090037" />

  86. <public type="id" name="lonyii_brightness_btn_icon" id="0x7f090038" />

  87. <public type="id" name="lonyii_brightness_btn_text" id="0x7f090039" />

  88. <public type="id" name="lonyii_brightness_btn_status_icon" id="0x7f09003a" />

  89. <public type="id" name="lonyii_wifi_btn" id="0x7f09003b" />

  90. <public type="id" name="lonyii_bt_btn" id="0x7f09003c" />

  91. <public type="id" name="lonyii_gps_btn" id="0x7f09003d" />

  92. <public type="id" name="lonyii_sound_btn" id="0x7f09003e" />

  93. <public type="id" name="lonyii_rotation_btn" id="0x7f09003f" />

  94. <public type="id" name="lonyii_mobiledata_btn" id="0x7f090040" />

  95. <public type="id" name="lonyii_flight_btn" id="0x7f090041" />

  96. <public type="id" name="lonyii_sync_btn" id="0x7f090042" />

  97. <public type="id" name="lonyii_brightness_btn" id="0x7f090043" />

  98. <public type="id" name="lonyii" id="0x7f090044" />

  99. <public type="id" name="lonyii_shutdown_btn_icon" id="0x7f090045" />

  100. <public type="id" name="lonyii_shutdown_btn_text" id="0x7f090046" />

  101. <public type="id" name="lonyii_shutdown_btn_status_icon" id="0x7f090047" />

  102. <public type="id" name="lonyii_shutdown_btn" id="0x7f090048" />

看type,其中drawable就是我们上面提取的图片,string就是在strings.xml里面的字符串,记下有哪些,待会去strings.xml里面复制,id和string类似,是在ids.xml里面的,也记下来先,layout即是xml布局文件,都在SystemUI\res\layout这个文件夹里面,

字符类提取:

1.strings.xml

复制public.xml里面看到的string字符串:

  1. <string name="lonyii_wifi_text" />

  2. <string name="lonyii_bluetooth_text" />

  3. <string name="lonyii_gps_text" />

  4. <string name="lonyii_mobiledata_text" />

  5. <string name="lonyii_sound_vibration_text" />

  6. <string name="lonyii_silent_text" />

  7. <string name="lonyii_vibration_text" />

  8. <string name="lonyii_rotation_text" />

  9. <string name="lonyii_error_text" />

  10. <string name="lonyii_sound_text" />

  11. <string name="location_3rdparty_gps_dialogtext">By selecting \"Standalone GPS services\", you are allowing access to all location information by any third party through web access or any software or peripheral components you chose to install, download, add/or attach to the device or any other means. Enabling this functionality could pose certain risks to users of this device.</string>

  12. <string name="mobiledata_dialogtext">You will no longer be able to use data applications such as Browser, Email and YouTube via mobile network. Calls and text messages will continue to function. Continue?</string>

  13. <string name="warning_alert_check">Do not display this message again.</string>

  14. <string name="mobiledataconnection_dialogtext">Mobile data connection is currently disabled. You need to connect Mobile data to use data applications such as Browser, Email and YouTube via mobile network. Do you want to make the connection?</string>

  15. <string name="location_title">My location</string>

  16. <string name="mobiledata_title">Mobile data</string>

  17. <string name="mobiledata_connect">Connect</string>

  18. <string name="mobiledataconnection_title">Mobile data connection</string>

  19. <string name="agree">Agree</string>

  20. <string name="lonyii_flight_text" />

  21. <string name="lonyii_sync_text" />

  22. <string name="lonyii_brightness_text" />

  23. <string name="shutdown_confirm">Your phone will take a rest from You.</string>

  24. <string name="lonyii_shutdown_text">Shutdown</string>

  25. <string name="hamster">ArgenStone</string>

复制代码

2.ids.xml

复制public.xml里面看到的id字符串:

  1. <item type="id" name="lonyii_quick_settings">false</item>

  2. <item type="id" name="lonyii_wifi_btn_icon">false</item>

  3. <item type="id" name="lonyii_wifi_btn_text">false</item>

  4. <item type="id" name="lonyii_wifi_btn_status_icon">false</item>

  5. <item type="id" name="lonyii_bt_btn_icon">false</item>

  6. <item type="id" name="lonyii_bt_btn_text">false</item>

  7. <item type="id" name="lonyii_bt_btn_status_icon">false</item>

  8. <item type="id" name="lonyii_gps_btn_icon">false</item>

  9. <item type="id" name="lonyii_gps_btn_text">false</item>

  10. <item type="id" name="lonyii_gps_btn_status_icon">false</item>

  11. <item type="id" name="lonyii_mobiledata_btn_icon">false</item>

  12. <item type="id" name="lonyii_mobiledata_btn_text">false</item>

  13. <item type="id" name="lonyii_mobiledata_btn_status_icon">false</item>

  14. <item type="id" name="lonyii_rotation_btn_icon">false</item>

  15. <item type="id" name="lonyii_rotation_btn_text">false</item>

  16. <item type="id" name="lonyii_rotation_btn_status_icon">false</item>

  17. <item type="id" name="lonyii_sound_btn_icon">false</item>

  18. <item type="id" name="lonyii_sound_btn_text">false</item>

  19. <item type="id" name="lonyii_sound_btn_status_icon">false</item>

  20. <item type="id" name="gps_Text">false</item>

  21. <item type="id" name="mobiledata_text">false</item>

  22. <item type="id" name="mobiledata_checkbox">false</item>

  23. <item type="id" name="lonyii_flight_btn_icon">false</item>

  24. <item type="id" name="lonyii_flight_btn_text">false</item>

  25. <item type="id" name="lonyii_flight_btn_status_icon">false</item>

  26. <item type="id" name="lonyii_sync_btn_icon">false</item>

  27. <item type="id" name="lonyii_sync_btn_text">false</item>

  28. <item type="id" name="lonyii_sync_btn_status_icon">false</item>

  29. <item type="id" name="lonyii_brightness_btn_icon">false</item>

  30. <item type="id" name="lonyii_brightness_btn_text">false</item>

  31. <item type="id" name="lonyii_brightness_btn_status_icon">false</item>

  32. <item type="id" name="lonyii_wifi_btn">false</item>

  33. <item type="id" name="lonyii_bt_btn">false</item>

  34. <item type="id" name="lonyii_gps_btn">false</item>

  35. <item type="id" name="lonyii_sound_btn">false</item>

  36. <item type="id" name="lonyii_rotation_btn">false</item>

  37. <item type="id" name="lonyii_mobiledata_btn">false</item>

  38. <item type="id" name="lonyii_flight_btn">false</item>

  39. <item type="id" name="lonyii_sync_btn">false</item>

  40. <item type="id" name="lonyii_brightness_btn">false</item>

  41. <item type="id" name="lonyii">false</item>

  42. <item type="id" name="lonyii_shutdown_btn_icon">false</item>

  43. <item type="id" name="lonyii_shutdown_btn_text">false</item>

  44. <item type="id" name="lonyii_shutdown_btn_status_icon">false</item>

  45. <item type="id" name="lonyii_shutdown_btn">false</item>

文件部分提取,就是layout了,从public.xml可得知有以下几个布局文件

  1. lonyii_gps_alertdialog.xml

  2. lonyii_mobiledata_alertdialog.xml

  3. lonyii_mobiledata_offdialog.xml

  4. lonyii_quick_settings.xml

另外因为在status_bar_expanded.xml里面有一句关键代码  即<include layout="@layout/lonyii_quick_settings" />,这句话要插入到你要放快捷面板的地方,不然你就算把其它全弄好了还是会不显示的

-------------------------------------------------

至此,该提取的都提取完了,下面是最繁琐的部分了

----第一步,将提取的东西放入相应的地方

这里有个算是小技巧吧,public.xml里面的东西不用提取,原因后面会提到

注:以下出现的SystemUI.apk均是指待添加快捷面板的SystemUI.apk

.把图片放到你要添加快捷面板的系统的SystemUI.apk(当然要反编译)的对应目录,即SystemUI\res\drawable-hdpi

.把lonyii文件夹整个复制到SystemUI\smali\com\android\systemui\statusbar,新手不要改文件夹名字,不然会没用的。

.layout里面的文件复制到SystemUI\res\layout

.在SystemUI\res\layout\status_bar_expanded.xml在适当的位置添加一句<include layout="@layout/lonyii_quick_settings" />,参考小猪的布局  status_bar_expanded.rar (1.08 KB, 下载次数: 182)

.SystemUI\res\values\strings.xml文件里照原有的格式添加前面提取的strings

.SystemUI\res\values\ids.xml ,同上

OK了,重编译吧,不出意外的话应该能顺利编译成功的

到这了,还不能用,

为了避免签名问题,统一一下步骤吧

把编译好的文件压进原来的SystemUI.apk(貌似AndroidMainfest.xml不能弄进去,不是很清楚,最好不用吧)

----第二步:再次反编译SystemUI.apk

打开SystemUI\res\values\public.xml,是不是发现了很多:书签1的代码?

现在应该知道为什么之前不用提取public.xml里的东西了吧

注意这里的id=后面的数值,这些数值有81个地方要更新到smali快捷面板主程序中

这一步是最后一步,也是最繁琐的一步,考验耐心 - -至少我在写DEFY通用补丁这个功能的时候就是自己手动一个个查找public.xml里面的原始数值在快捷面板smali里面对应的地方,然后用新编译生成的public.xml找到对应的新数值替换进去,不然你不替换的话,一开机拉下通知栏就会发现快捷面板位置会惨不忍睹的  - -

重新编译后替换进手机,这些都是基本功就不多说了

the END.

广告一下:
DEFY通用补丁
可以帮你全自动添加快捷面板,原理及实现方法就是以上所述,唯一影响通用的就是status_bar_expanded.xml这个布局文件了,2.3的系统一般都带有SystemUI.apk,2.2不带的,所以2.2不可用,未deodex的系统也不可用

通知栏快捷按钮自定义教程以及快捷面板提取的思路-转自魔趣论坛-lonyii2的更多相关文章

  1. hexo博客yili主题个性化自定义教程(1) ——借鉴中学习,初认yili主题

    文章转载于:hexo博客yili主题个性化自定义教程(1) --借鉴中学习,初认yili主题 这个博客跌跌撞撞也弄了好多天了,由于Next主题不知道什么情况,被我玩坏了.所以换了一个主题. 大名鼎鼎的 ...

  2. 《吐血整理》保姆级系列教程-玩转Fiddler抓包教程(4)-会话面板和HTTP会话数据操作详解

    1.简介 按照从上往下,从左往右的计划,今天就轮到介绍和分享Fiddler的会话面板了. 2.会话列表 (Session list) 概览 Fiddler抓取到的每条http请求(每一条称为一个ses ...

  3. navigationController 的返回按钮自定义

    1: navigationController 的返回按钮自定义 SecondViewController *secondVC = [SecondViewController new];       ...

  4. 纯CSS3彩色边线3D立体按钮制作教程

    原文:纯CSS3彩色边线3D立体按钮制作教程 今天我们来分享一款利用纯CSS3实现的3D按钮,这款按钮的一个特点是有彩色的边线,这让整个按钮显得比较多姿多彩,没那么枯燥无趣.本文不仅可以让大家看到演示 ...

  5. 安卓系统浏览器中select下拉按钮无法弹出选择面板奇怪问题解决

    今天遇到个让人崩溃的问题: 平台: 安卓 4.0 描述: 使用 appcan 开发 hybrid 应用,手机上点击下拉选框按钮无法弹出选择面板. 说明: 发现 webkit 内核 position:f ...

  6. Android单个按钮自定义Dialog

    代码改变世界 Android单个按钮自定义Dialog dialog_layout.xml <?xml version="1.0" encoding="utf-8& ...

  7. cesium默认全屏按钮自定义

    cesium默认全屏按钮自定义 1  隐藏默认的svg 2  修改它默认的按钮边框,背景 3   修改它点击时的样式 代码如下: .cesium-viewer-fullscreenContainer ...

  8. GIS自定义地理处理工具--极值提取

    GIS自定义地理处理工具--极值提取 关键词:最大值提取,最小值提取,极值提取,极小值提取,极大值提取 商务合作,科技咨询,版权转让:向日葵,135—4855__4328,xiexiaokui#qq. ...

  9. 自定义java代码快捷生成器使用与问题解决

    对于很多的工作了有几年的开发人员来说,初期都是逐个单词语法的自己编写的.而一旦技术水平提高了到了一定的层次之后,在同时工作量的加大,要求我们必须加快提高工作效率.因此就可以利用必要的快捷开发手段和工具 ...

随机推荐

  1. Java---练习:文件切割与合并(1)

    实现对大文件的切割与合并. 按指定个数切(如把一个文件切成10份)或按指定大小切(如每份最大不超过10M),这两种方式都可以. 示例程序说明: 文件切割:把一个文件切割成多个碎片,每个碎片的大小不超过 ...

  2. doxygen学习笔记

    下载doxygen:http://www.cnblogs.com/duxiuxing/p/4301015.html 学习思路 doxygen能够根据代码和注释生成文档.可想而知,doxygen对注释的 ...

  3. centOS 6.4挂载centOS分区

    今天想用centOS打开在windows下编辑的emacs笔记,发现好像不可以自动挂载nfts分区,搜了一下,发现一大坨,还是发个文来标记下好: 首先,安装rpmforge软件库的源 命令行下输入下面 ...

  4. 深入理解object C中复制对象的用法(二)

    第五.对象的自定义拷贝 对象拥有复制特性,必须实现NSCopying,NSMutableCopying协议,实现该协议的copyWithZone方法和mutableCopyWithZone方法 深拷贝 ...

  5. SQL - 添加外键

    不解释: ---先创建外键的column ALTER TABLE tblLicenses ADD ProductID int not null; ---添加外键 ALTER TABLE tblLice ...

  6. javascript 判断是否是数组

    function isArray(object){ return object && typeof object==='object' && typeof object ...

  7. Android ViewFlow的一个例子

    完成这个例子的步骤: 1.下载ViewFlow的源码,然后将类ViewFlow放在自己的工程的src的某个包下. 2.下载的源码里有2个工程view flow,viewflow-example.将vi ...

  8. TCP服务器:多进程

    代码: server: #include<netinet/in.h> #include<sys/socket.h> #include<sys/wait.h> #in ...

  9. 百练2755 奇妙的口袋 【深搜】or【动规】or【普通递归】or【递推】

    总Time Limit:  10000ms  Memory Limit:  65536kB 有一个奇妙的口袋.总的容积是40,用这个口袋能够变出一些物品,这些物品的整体积必须是40.John如今有n个 ...

  10. Java 编程的动态性 第1 部分: 类和类装入--转载

    原文地址:http://www.ibm.com/developerworks/cn/java/j-dyn0429/ 本文是这个新系列文章的第一篇,该系列文章将讨论我称之为 Java 编程的动态性的一系 ...