|
本帖最后由 923664320 于 2015-8-30 22:23 编辑
天语火星一号H1官方ROM有双击唤醒,移植小米ROM后要反编译services.jar和内核还要在system\app下面加TYSmartWakeSettings.apk才能双击home键唤醒。换句话说我们也可以给红米note2加入双击唤醒功能,只要反编译services.jar和内核再加入TYSmartWakeSettings.apk这个双击唤醒程序就行了。
原帖来自5 9 2 z n 不知为何复制的教程会有表情图片,请大神百度:NIbiruH1 双击唤醒修复教程(保证有用 前提是会反编译)
希望红米note2论坛的大神能给红米note2加入双击唤醒。
这是services.jar修改前和修改后的样本和TYSmartWakeSettings.apk双击唤醒程序http://pan.baidu.com/s/1hqF9OJM供参考
教程如下:
不同的rom 有些许差异 需要自己去考量
比如fiui rom本身就添加了双击home的功能。。。。所以你只能二选一了
h1c也能用
以下代码原自官方rom和yunos
注意不要去搜索 .line XXXX 因为代码变动 .line 不准的
反编译server.jar
com\android\server\pm\PackageManagerService.smali
修改前(关键部分)
.prologue
.line 2821
if-nez p0, :cond_8
.line 2822
if-nez p1, :cond_6
const/4 v6, 0x1
.line 2841
:goto_5
return v6
.line 2822
:cond_6
const/4 v6, -0x1
goto :goto_5
修改后(对比上面的做了修改)
.prologue
.line 2821
if-nez p0, :cond_8
.line 2822
if-nez p1, :cond_6
const/4 v6, 0x1
.line 2841
:goto_5
const/4 v6, 0x0
.line 2822
:cond_6
const/4 v6, 0x0
return v6
文件:com\android\server\power\DisplayPowerController.smali
修改前(关键部分,红色是修改的内容)
.field private static final ELECTRON_BEAM_ON_ANIMATION_DURATION_MILLIS:I = 0xfa
.field private static final LIGHT_SENSOR_RATE_MILLIS:I = 0x64
.field private static final LONG_TERM_AVERAGE_LIGHT_TIME_CONSTANT:J = 0x1f4L
修改后
.field private static final ELECTRON_BEAM_ON_ANIMATION_DURATION_MILLIS:I = 0xfa
.field private static final LIGHT_SENSOR_RATE_MILLIS:I = 0xc8
.field private static final LONG_TERM_AVERAGE_LIGHT_TIME_CONSTANT:J = 0x1f4L
com\android\server\power\DisplayPowerState.smali
搜索 (搜索红色的函数名即可)
invoke-direct {v2, p0}, Lcom/android/server/power/DisplayPowerState$1;-><init>(Lcom/android/server/power/DisplayPowerState;)V
iget-object v3, p0, Lcom/android/server/power/DisplayPowerState;->mHandlerandroid/os/Handler;
invoke-virtual {v1, v2, v0, v4, v3}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
.line 136
return-void
.end method
在下面插入一个函数
.method public constructor <init>(Lcom/android/server/power/ElectronBeam;Lcom/android/server/power/DisplayBlanker;Lcom/android/server/LightsService$Light;Lcom/android/server/LightsService$Light;Landroid/content/Context;)V
.registers 6
.param p1, "electronBean" # Lcom/android/server/power/ElectronBeam;
.param p2, "displayBlanker" # Lcom/android/server/power/DisplayBlanker;
.param p3, "backlight" # Lcom/android/server/LightsService$Light;
.param p4, "buttons" # Lcom/android/server/LightsService$Light;
.param p5, "context" # Landroid/content/Context;
.prologue
.line 148
invoke-direct {p0, p1, p2, p3, p5}, Lcom/android/server/power/DisplayPowerState;-><init>(Lcom/android/server/power/ElectronBeam;Lcom/android/server/power/DisplayBlanker;Lcom/android/server/LightsService$Light;Landroid/content/Context;)V
.line 149
if-eqz p4, :cond_7
.line 150
iput-object p4, p0, Lcom/android/server/power/DisplayPowerState;->mButtonLightcom/android/server/LightsService$Light;
.line 152
:cond_7
return-void
.end method
本帖隐藏的内容反编译boot 在init.rc下插入
#TYDRV chenwsh 2013-12-02 add for CABC begin
chmod 0664 /sys/tym_devices/lcd_cabc/lcd_cabc
chown system system /sys/tym_devices/lcd_cabc/lcd_cabc
#TYDRV chenwsh 2013-12-02 add for CABC end
#TYDRV chenwsh 2013-12-23 add for glove mode begin
chmod 0664 /sys/tym_devices/touch_idf/glove_switch
chown system system /sys/tym_devices/touch_idf/glove_switch
#TYDRV chenwsh 2013-12-23 add for glove mode end
#TYDRV chenwsh 2013-12-23 add for gesture mode begin
chmod 0664 /sys/tym_devices/touch_idf/gesture_mode_switch
chown system system /sys/tym_devices/touch_idf/gesture_mode_switch
chmod 0664 /sys/tym_devices/touch_idf/gesture_letter_switch
chown system system /sys/tym_devices/touch_idf/gesture_letter_switch
chmod 0664 /sys/tym_devices/touch_idf/gesture_sign_switch
chown system system /sys/tym_devices/touch_idf/gesture_sign_switch
#TYDRV chenwsh 2013-12-23 add for gesture mode end
#ydss lydhh Add shoutao moshi begin
echo 1 >/sys/tym_devices/touch_idf/glove_switch
echo 1 >/sys/tym_devices/touch_idf/gesture_letter_switch
echo 1 >/sys/tym_devices/touch_idf/gesture_mode_switch
echo 8 >/sys/tym_devices/touch_idf/gesture_sign_switch
echo 1 >/sys/tym_devices/touch_idf/gesture_mode_switch
#ydss lydhh 2015-04-02 add shoutaomoshi end
|
|