[i=s] 本帖最后由 nemogz 于 2012-10-3 19:51 编辑 [/i]
SH-12C无论用最低亮度或是自动亮度,晚上关灯后看网页都还是觉得刺眼。以前用Brightness Profiles:
https://play.google.com/store/apps/details?id=com.angrydoughnuts.android.brightprof&feature=search_result#?t=W10.
可以看到SH-12C的缺省最低亮度为8%。
打算在状态栏SystemUI.apk、 SystemUI.odex做修改。
1、用apkdb右键合并SystemUI.odex到SystemUI.apk
2、SearchMyFiles搜索brightness得知大概要修改ButtonAreaView.smali
3、
4、apkdb右键查看打包出来classes.dex源码
以及
5、修改很简单,将最低亮度值30改为0即可,当然在ButtonAreaView.smali里面为十六进制0x1e ---->0x00,有四个地方。
6、由于修改的是包含在odex里smali文件,所以回编译后要重新在手机odex化,并恢复旧签名:
重启后,状态右上角的亮度选择界面并无变化,但最低亮度改为0,可以用Brightness Profiles验证后删除Brightness Profiles。
晚上看手机舒服多了。{:96_526:}{:96_526:}{:96_526:}
懒虫包:浏览附件状态栏 最低亮度.rar
(相关工具和知识见http://bbs.blueshow.net/thread-1776577-1-1.html)
SH-12C无论用最低亮度或是自动亮度,晚上关灯后看网页都还是觉得刺眼。以前用Brightness Profiles:
https://play.google.com/store/apps/details?id=com.angrydoughnuts.android.brightprof&feature=search_result#?t=W10.
可以看到SH-12C的缺省最低亮度为8%。
打算在状态栏SystemUI.apk、 SystemUI.odex做修改。
1、用apkdb右键合并SystemUI.odex到SystemUI.apk
2、SearchMyFiles搜索brightness得知大概要修改ButtonAreaView.smali
3、
代码:
java -jar baksmali-1.2.6.jar -x SystemUI.odex
java -Xmx512M -jar smali-1.2.6.jar out -o classes.dex
代码:
private static int getBrightnessState(Context paramContext)
{
try
{
if (IPowerManager.Stub.asInterface(ServiceManager.getService("power")) != null)
{
int j = Settings.System.getInt(paramContext.getContentResolver(), "screen_brightness");
if (j < 130)
i = 30;
while (true)
{
return i;
if (j < 255)
{
i = 130;
continue;
}
i = 255;
}
}
}
catch (Exception localException)
{
while (true)
{
Slog.e("ButtonAreaView", "getBrightness : Exception " + localException);
int i = 130;
}
}
}
代码:
private void toggleBrightness()
{
if (this.mBrightnessModeChangeWait == true)
return;
while (true)
{
int m;
try
{
IPowerManager localIPowerManager = IPowerManager.Stub.asInterface(ServiceManager.getService("power"));
if (localIPowerManager == null)
break;
ContentResolver localContentResolver = this.mContext.getContentResolver();
int i = 1;
j = Settings.System.getInt(localContentResolver, "screen_brightness");
k = 0;
m = 0;
if (!this.mContext.getResources().getBoolean(17629189))
break label260;
m = Settings.System.getInt(localContentResolver, "screen_brightness_mode");
break label260;
if ((!this.mContext.getResources().getBoolean(17629189)) || (k == m))
continue;
Settings.System.putInt(this.mContext.getContentResolver(), "screen_brightness_mode", k);
this.mBrightnessModeChangeWait = true;
this.mBrightness = n;
i = 0;
if (i == 0)
break;
localIPowerManager.setBacklightBrightness(n);
Settings.System.putInt(localContentResolver, "screen_brightness", n);
}
catch (RemoteException localRemoteException)
{
int j;
Slog.d("ButtonAreaView", "toggleBrightness: " + localRemoteException);
break;
if (j >= 130)
continue;
n = 130;
continue;
if (j >= 255)
continue;
n = 255;
continue;
k = 1;
n = 30;
continue;
}
catch (Settings.SettingNotFoundException localSettingNotFoundException)
{
Slog.d("ButtonAreaView", "toggleBrightness: " + localSettingNotFoundException);
}
break;
label260: if (m != 1)
continue;
int n = 30;
int k = 0;
}
}
6、由于修改的是包含在odex里smali文件,所以回编译后要重新在手机odex化,并恢复旧签名:
代码:
adb push SystemUI.apk /data/local/SystemUI.apk
adb shell
su
busybox mount -o remount,rw /system
busybox cp -f /system/app/SystemUI.apk /system/app/SystemUI.apk.bak
busybox cp -f /system/app/SystemUI.odex /system/app/SystemUI.odex.bak
busybox cp -f /data/local/SystemUI.apk /system/app/SystemUI.apk
rm /system/app/SystemUI.odex
dexopt-wrapper /system/app/SystemUI.apk /system/app/SystemUI.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar
busybox dd if=/system/app/SystemUI.odex.bak of=/system/framework/SystemUI.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
busybox cp -f /system/app/SystemUI.apk.bak /system/app/SystemUI.apk
chmod 644 /system/app/SystemUI.odex
chown root.root /system/app/SystemUI.odex
rm /system/app/SystemUI.apk.bak
rm /system/app/SystemUI.odex.bak
reboot
晚上看手机舒服多了。{:96_526:}{:96_526:}{:96_526:}
懒虫包:浏览附件状态栏 最低亮度.rar
(相关工具和知识见http://bbs.blueshow.net/thread-1776577-1-1.html)