4.0的状态栏和2.3透明修改的地方不同,如果大家不能正常编译apk,说明apktool工具需要更新了,新的工具是向下兼容的,可以在网上下载到。
1.反编译环境准备
首先配置框架环境,安装配置Java环境(大家可以搜索网上教程)。提取rom框架资源文件(framework-res.apk),然后安装到计算机。安装命令是:apktool if framework-res.apk 安装后就会得到:~\apktool\framework\1.apk
2.状态栏透明修改
修改drawables.xml:打开(建议使用notepad++)反编译SystemUI.apk后res\values和res\values-sw600dp文件夹里面的drawables.xml,将name="status_bar_background">#ff000000 的值修改,前2位是透明度,00是全透,ff全不透,80是50%左右透明,后6位是颜色值。如#63000000为黑色40%左右透明;
修改StatusBar.smali:打开\smali\com\android\systemui\statusbar\StatusBar.smali(这是classes.dex的编译内容),查找”new-instance v11,Landroid/view/WindowManager$LayoutParams;” 把const/16 v16,0x4 修改成const/16 v16, -0x3然后另存为保存,最后进行回编译,把回编译后的resources.arsc和classes.dex文件替换回源文件SystemUI.apk,然后将apk替换回手机(先在System下改好权限再替换到apk目录),替换好请删除data/dalvik-cache中的[url=mailto:system@app@SsystemUI.apk@classes.dex]system@app@SsystemUI.apk@classes.dex[/url],或进recovery清除dalvik-cache,否则重启后将其丑无比;
图片透明进阶:如果你想要更灵活的透明,例如过度透明,那可以使用图片透明。此前修改res\values\drawables.xml的“<item type="drawable" name="status_bar_background">”颜色处可改为“<drawablename="status_bar_background">@drawable/status_bar_background</drawable>”,只修改res\values里的drawables.xml就可以了,在\res\drawable-mdpi中放入透明状态栏图片status_bar_background.png(图片不放进去无法回编译),回编后将图片也拖入apk(记得压缩方式选存储(store))。
3.下拉通知栏透明修改
打开systemui\res\values\drawables.xml修改以下几项:
a.<item type="drawable"name="notification_item_background_color">通知条目背景
b.<item type="drawable"name="notification_item_background_color_pressed">通知条目按下背景
<item type="drawable"name="status_bar_recents_background_solid">
<item type="drawable"name="status_bar_recents_app_thumbnail_background">
c<item type="drawable"name="status_bar_notification_row_background_color">通知条目边界边界
d<item type="drawable"name="notification_header_bg"> 电源按钮背景,将于e叠加
e<item type="drawable"name="notification_tracking_bg"> 整个下拉背景色
<item type="drawable"name="recents_callout_line">
通知条目图片透明进阶:
systemui\res\values\drawables.xml增加2条对应条目背景
<drawablename="notification_item_background">@drawable/notification_item_background</drawable>
<drawablename="notification_item_background_pressed">@drawable/notification_item_background_pressed</drawable>
接着修改systemui\res\drawable\中相应内容
systemui\res\drawable\notification_row_bg.xml中的 <itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color_pressed"/>
<itemandroid:state_pressed="false"android:drawable="@drawable/notification_item_background_color" />改为
<item android:state_pressed="true"android:drawable="@drawable/notification_item_background_pressed"/>
<itemandroid:state_pressed="false"android:drawable="@drawable/notification_item_background" />;
systemui\res\drawable\stat_power_background.xml中的<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color_pressed"/>改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_pressed"/>;
systemui\res\drawable\status_bar_item_background.xml中的<item android:state_pressed="true"android:drawable="@drawable/notification_item_background_color" />改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background " />;
systemui\res\drawable\ ticker_background.xml中的<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color" />改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background " />;
然后在systemui\res\values\public.xml中加入2行
<public type="drawable"name="notification_item_background" id="0x7f02018e" />
<public type="drawable"name="notification_item_background_pressed" id="0x7f02018f"/>
这里的id号为新加的id序号。注意id要找到已有的<public type="drawable" 的最大序号,16进制,如果最后一个是"0x7f02018d"则从"0x7f02018e"开始加,每位加到f进位。每加一个id一定搜索一下是否有重复的id和name,否则无法回编
最后在systemui\res\drawable-mdpi\中放入2个编译出的.9.png文件,分别是notification_item_background.9.png和notification_item_background_pressed.9.png(即有黑边的.9.png文件),回编,回编好的目录里修改过的xml替换到apk相应目录里,再把处理好的.9.png文件拖入systemui\res\drawable-mdpi\中,再把回编好的resources.arsc替换到apk中。把修改好的SystemUI.apk放到system目录修改好权限,再替换到system\apk中,重启
1.反编译环境准备
首先配置框架环境,安装配置Java环境(大家可以搜索网上教程)。提取rom框架资源文件(framework-res.apk),然后安装到计算机。安装命令是:apktool if framework-res.apk 安装后就会得到:~\apktool\framework\1.apk
2.状态栏透明修改
修改drawables.xml:打开(建议使用notepad++)反编译SystemUI.apk后res\values和res\values-sw600dp文件夹里面的drawables.xml,将name="status_bar_background">#ff000000 的值修改,前2位是透明度,00是全透,ff全不透,80是50%左右透明,后6位是颜色值。如#63000000为黑色40%左右透明;
修改StatusBar.smali:打开\smali\com\android\systemui\statusbar\StatusBar.smali(这是classes.dex的编译内容),查找”new-instance v11,Landroid/view/WindowManager$LayoutParams;” 把const/16 v16,0x4 修改成const/16 v16, -0x3然后另存为保存,最后进行回编译,把回编译后的resources.arsc和classes.dex文件替换回源文件SystemUI.apk,然后将apk替换回手机(先在System下改好权限再替换到apk目录),替换好请删除data/dalvik-cache中的[url=mailto:system@app@SsystemUI.apk@classes.dex]system@app@SsystemUI.apk@classes.dex[/url],或进recovery清除dalvik-cache,否则重启后将其丑无比;
图片透明进阶:如果你想要更灵活的透明,例如过度透明,那可以使用图片透明。此前修改res\values\drawables.xml的“<item type="drawable" name="status_bar_background">”颜色处可改为“<drawablename="status_bar_background">@drawable/status_bar_background</drawable>”,只修改res\values里的drawables.xml就可以了,在\res\drawable-mdpi中放入透明状态栏图片status_bar_background.png(图片不放进去无法回编译),回编后将图片也拖入apk(记得压缩方式选存储(store))。
3.下拉通知栏透明修改
打开systemui\res\values\drawables.xml修改以下几项:
a.<item type="drawable"name="notification_item_background_color">通知条目背景
b.<item type="drawable"name="notification_item_background_color_pressed">通知条目按下背景
<item type="drawable"name="status_bar_recents_background_solid">
<item type="drawable"name="status_bar_recents_app_thumbnail_background">
c<item type="drawable"name="status_bar_notification_row_background_color">通知条目边界边界
d<item type="drawable"name="notification_header_bg"> 电源按钮背景,将于e叠加
e<item type="drawable"name="notification_tracking_bg"> 整个下拉背景色
<item type="drawable"name="recents_callout_line">
通知条目图片透明进阶:
systemui\res\values\drawables.xml增加2条对应条目背景
<drawablename="notification_item_background">@drawable/notification_item_background</drawable>
<drawablename="notification_item_background_pressed">@drawable/notification_item_background_pressed</drawable>
接着修改systemui\res\drawable\中相应内容
systemui\res\drawable\notification_row_bg.xml中的 <itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color_pressed"/>
<itemandroid:state_pressed="false"android:drawable="@drawable/notification_item_background_color" />改为
<item android:state_pressed="true"android:drawable="@drawable/notification_item_background_pressed"/>
<itemandroid:state_pressed="false"android:drawable="@drawable/notification_item_background" />;
systemui\res\drawable\stat_power_background.xml中的<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color_pressed"/>改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_pressed"/>;
systemui\res\drawable\status_bar_item_background.xml中的<item android:state_pressed="true"android:drawable="@drawable/notification_item_background_color" />改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background " />;
systemui\res\drawable\ ticker_background.xml中的<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background_color" />改为<itemandroid:state_pressed="true"android:drawable="@drawable/notification_item_background " />;
然后在systemui\res\values\public.xml中加入2行
<public type="drawable"name="notification_item_background" id="0x7f02018e" />
<public type="drawable"name="notification_item_background_pressed" id="0x7f02018f"/>
这里的id号为新加的id序号。注意id要找到已有的<public type="drawable" 的最大序号,16进制,如果最后一个是"0x7f02018d"则从"0x7f02018e"开始加,每位加到f进位。每加一个id一定搜索一下是否有重复的id和name,否则无法回编
最后在systemui\res\drawable-mdpi\中放入2个编译出的.9.png文件,分别是notification_item_background.9.png和notification_item_background_pressed.9.png(即有黑边的.9.png文件),回编,回编好的目录里修改过的xml替换到apk相应目录里,再把处理好的.9.png文件拖入systemui\res\drawable-mdpi\中,再把回编好的resources.arsc替换到apk中。把修改好的SystemUI.apk放到system目录修改好权限,再替换到system\apk中,重启