康佳v987吧 关注:38贴子:1,733
  • 1回复贴,共1

【反编译】状态栏流量双排显示 - 上传和下载

只看楼主收藏回复

1.可以显示两种网速,单排、双排。
2.双排网速分为上载与下载速度分开显示。
废话不多说:
1 、反编译SystemUI.apk
打开res/layout/status_bar.xml
在你喜欢的位置添加如下代码:
<include android:layout_marginRight="2.0dip" layout="@layout/wm_network_stats" />
<com.fiqih.anaknya.mbol.Traffic android:textAppearance="@style/TextAppearance.StatusBar.Traffic" android:gravity="left|center" android:id="@id/traffic" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="4.0dip" android:singleLine="true" />
大家请留意。上面一行代码为双排代码,下面为单排常规流量速度显示。
2、 打开res/values/ids.xml
在 </resources>的上面添加如下代码:
<item type="id" name="traffic">false</item>
<item type="id" name="bubble_r">false</item>
<item type="id" name="bubble_l">false</item>
3、 打开res/values/styles.xml
在 </resources>的上面添加如下代码:
<style name="TextAppearance.StatusBar.NetworkStats" parent="@*android:style/TextAppearance.StatusBar">
<item name="android:textSize">10.0dip</item>
<item name="android:textColor">#ff1ac31a</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1.0</item>
</style>
<style name="TextAppearance.StatusBar.Traffic" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">14.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
</style>
4、 解压附件(在这里请自寻文件),复制res文件夹与smali文件夹覆盖到你编译的apk中覆盖。回编译
5、 再次反编译新生成的APK,打开res/values/public.xml
找到如下:
<public type="id" name="bubble_r" id="0x7......." />
<public type="id" name="bubble_l" id="0x7......." />
其中0x7......代表编译自动生成的ID每个人都不一样,所以我就不列举出来了。
6、 打开/smali/com/fiqih/anaknya/mbol/NetworkStatsView.smali
搜索: 0x7f0c00f7并将此ID值替换为<public type="id" name="bubble_r" id="0x7......." />中的ID
搜索: 0x7f0c00f8并将此ID值替换为<public type="id" name="bubble_l" id="0x7......." />中的ID
修改好了保存退出,回编译。提取修改与添加的文件替换进原UI里边替换进系统重启手机。
有能力可提取设置程序拼进系统设置里面。


来自Android客户端1楼2015-03-09 12:47回复
    虽然我用不到,但还是要顶一个的


    来自手机贴吧2楼2015-03-10 19:27
    回复