SH-12C之个性化一 最低亮度

nemogz

普通会员
2007-08-21
259
0
0
[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、
代码:
java -jar baksmali-1.2.6.jar -x SystemUI.odex
java -Xmx512M -jar smali-1.2.6.jar out -o classes.dex
4、apkdb右键查看打包出来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;
}
}
5、修改很简单,将最低亮度值30改为0即可,当然在ButtonAreaView.smali里面为十六进制0x1e ---->0x00,有四个地方。

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
重启后,状态右上角的亮度选择界面并无变化,但最低亮度改为0,可以用Brightness Profiles验证后删除Brightness Profiles。

晚上看手机舒服多了。{:96_526:}{:96_526:}{:96_526:}

懒虫包:浏览附件状态栏 最低亮度.rar
(相关工具和知识见http://bbs.blueshow.net/thread-1776577-1-1.html

 

异雪罗刹

普通会员
2011-12-17
750
0
0
想请教下LZ我的SH-12C用了有快将近一年了,但是最近老是出问题。接电话和拨电话经常听不到声音,而且电量用下去的非常快,一天不到就耗下去近百分之50的电量。不知道这算不算正常。我已经试着重新恢复出厂设置,也尽量少装软件,但是电池还是很不耐用,会是软件不兼容的问题导致的吗?我都尽量少装或者不装软件了。想请教下LZ到底会是什么问题,急啊!盼回复,谢谢!
 

nemogz

普通会员
2007-08-21
259
0
0
异雪罗刹 发表于 2012-9-29 20:10
想请教下LZ我的SH-12C用了有快将近一年了,但是最近老是出问题。接电话和拨电话经常听不到声音,而且电量用 ...
如果手机没有异常发热状况,绝大多数是锂电问题,锂电本来质量就难保证一致,差一点的锂电充电次数小于500次。

TB已有电池卖,可考虑换个电池试试。
 
L

lats1881

游客
喔喔喔喔喔 期待超久的耶 感謝版主再度分享心得
 
S

STUNE11

游客
感谢楼主,,这个要研究研究。。好多啊
 

asian26

普通会员
2012-10-06
6
0
0
确实,躺床上开最低亮度还是晃眼睛,LZ有心了w回头试着折腾看看~
 

lei0512

普通会员
2011-08-16
4
0
0
学习了!我这机子就是有时候信号莫名丢失,打电话的时候也是,突然就掉线了!晕死!