[DEV][MODDING] CRT, Airview, 4-way reboot, ink effect, phone, sms..etc [9/Dec/2013]

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
@majdinj THIS from phoenix rom have work for me
im looking on it and do the same but the mod doesnt work when screen off
May be the timeout event is your problem..
OK try this one:
- Search for this static field ".field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2" and add this line bellow it (the blue one):
Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

[B][COLOR="Blue"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR][/B]

.field static final MINI_APP_DIALOG_LAYER:I = 0x5
Here you can set the timeout for long press event of volume rocker, here it is set to 400 millisecond (0x190).
Then change this code method in my tutorial ".method handleVolumeLongPress(I)V", and ".method handleVolumeLongPressAbort()V" to:
Code:
[B][COLOR="Blue"].method handleVolumeLongPress(I)V
    .registers 6

    const/4 v1, 0x1

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    const/4 v1, 0x0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    const/16 v1, 0x18

    if-ne p1, v1, :cond_majdi

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    :goto_nj
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I

    int-to-long v2, v2

    invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void

    :cond_majdi
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    goto :goto_nj
.end method

.method handleVolumeLongPressAbort()V
    .registers 3

    const/4 v1, 0x0

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    return-void
.end method[/COLOR][/B]
I have tested this new method in my device and it worked great with set timeout delay..
I will update the post soon

EDIT:
The post is already modified for the new way.. have fun
 
Last edited:

grilleld

Senior Member
Sep 3, 2012
847
2,074
0
Đà Lạt
May be the timeout event is your problem..
OK try this one:
- Search for this static field ".field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2" and add this line bellow it (the blue one):
Code:
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2

[B][COLOR="Blue"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR][/B]

.field static final MINI_APP_DIALOG_LAYER:I = 0x5

Then change this code method in my tutorial ".method handleVolumeLongPress(I)V", and ".method handleVolumeLongPressAbort()V" to:
Code:
[B][COLOR="Blue"].method handleVolumeLongPress(I)V
    .registers 6

    const/4 v1, 0x1

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    const/4 v1, 0x0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z

    const/16 v1, 0x18

    if-ne p1, v1, :cond_majdi

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    :goto_nj
    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    sget v2, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I

    int-to-long v2, v2

    invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    return-void

    :cond_majdi
    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    goto :goto_nj
.end method

.method handleVolumeLongPressAbort()V
    .registers 3

    const/4 v1, 0x0

    move-object/from16 v0, p0

    iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    return-void
.end method[/COLOR][/B]
I have tested this new method in my device and it worked great with set timeout delay..
I will update the post soon

EDIT:
The post is already modified for the new way.. have fun
thanks :d try it now

EDIT: oh god still not work for me..wt ..?? (do u think the problem is beat audio i have install ?
do u have any ideas about torch on lockscreen ?
im sure i have do it right but stuck at boot animation screen all the time
 
Last edited:

ezaechiel

Senior Member
Mar 19, 2013
1,017
1,032
0
Issou
team.5n0w.fr
Hi majdinj,

May I propose an addendum to ink effect in 240 dpi ?

In 240dpi to activate it, another change must be made.

1 - Backsmali framework-res.apk
2 - Go to framework-res.apk\res\values-hdpi
3 - Open Bools.xml
4 - Make this change :

From :

Code:
<bool name="config_isWaterRippleEnabled">[COLOR="Red"]false[/COLOR]</bool>
to

Code:
<bool name="config_isWaterRippleEnabled">[COLOR="Blue"]true[/COLOR]</bool>
And it's done ^^.
 
Last edited:
  • Like
Reactions: majdinj

remuntada78

Senior Member
Jun 2, 2013
903
964
0
I am following the guide http://forum.xda-developers.com/showthread.php?t=1573032 for 4way reboot for JB that says:

In file "GlobalActions$99.smali" there is id 0x1110008, you might want to check that this id is same in you roms puplic.xml ( config_sf_slowBlur ). In gingerbread roms this did not change, but not I'm not sure about these ICS roms.

now the value in my public.xml for conf_sf_slowBlur is 0x1110009, I have to change the value in GlobalActions$99.smali?
 
Last edited:
  • Like
Reactions: majdinj

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
I am following the guide http://forum.xda-developers.com/showthread.php?t=1573032 for 4way reboot for JB that says:

In file "GlobalActions$99.smali" there is id 0x1110008, you might want to check that this id is same in you roms puplic.xml ( config_sf_slowBlur ). In gingerbread roms this did not change, but not I'm not sure about these ICS roms.

now the value in my public.xml for conf_sf_slowBlur is 0x1110009, I have to change the value in GlobalActions$99.smali?
Not necessarily for JB or ICS,, only for:
0x104000a = 0x0104000a = "string" name="ok"
0x104 = 0x01040000 = "string" name="cancel"


>>> New mod added
Browser Edge Zoom Enabling
See post #75
 

ezaechiel

Senior Member
Mar 19, 2013
1,017
1,032
0
Issou
team.5n0w.fr
Hi majdinj,

are you sure of the line in blue :

Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 28
    [COLOR="Blue"].param p1, "event"    # Landroid/view/MotionEvent;[/COLOR]

    .prologue
    .line 207
    move-object/from16 v0, p0
Because I can't compile the file with this line.
 

Attachments

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Hi majdinj,

are you sure of the line in blue :

Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .registers 28
    [COLOR="Blue"].param p1, "event"    # Landroid/view/MotionEvent;[/COLOR]

    .prologue
    .line 207
    move-object/from16 v0, p0
Because I can't compile the file with this line.
yes,the same error happened when I recompiled the classout
Have you update baksmali and smali codes,,,
The problem arise only with old codes..

I am using baksmali / smali manager v1.5 with the latest baksmali and smali codes (15/6/2013) and worked flawlessly ( just re-tested one minute ago!!)

Update the codes and try again, I will be waiting to help ya
 

ezaechiel

Senior Member
Mar 19, 2013
1,017
1,032
0
Issou
team.5n0w.fr
Have you update baksmali and smali codes,,,
The problem arise only with old codes..

I am using baksmali / smali manager v1.5 with the latest baksmali and smali codes (15/6/2013) and worked flawlessly ( just re-tested one minute ago!!)

Update the codes and try again, I will be waiting to help ya
Will test it asap, thanks for your answer, you're right I'm using this smali/backsmali code since april so it might be out of date ^^.
 

majdinj

Senior Member
Nov 25, 2006
980
3,437
0
AlAhsa
Will test it asap, thanks for your answer, you're right I'm using this smali/backsmali code since april so it might be out of date ^^.


This is also the same complain in my other thread of this mod,,, but solved when use baksmali tool that has the latest codes
Thanks for this mod.
But i have an Error when i Compile the framework.jar

Code:
D:\APK>java -jar apktool.jar b framework.jar.out
I: Checking whether sources has changed...
I: Smaling...
[1264,4] Error for input '.param': Invalid directive
[1264,11] mismatched input 'p1' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: D:\APK\framework.jar.out\smali\android\view\ScaleGestureDetector.smali
        at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
OK. My mistake..... Works fine with the Baksmali tool ;)
 

Javho

Senior Member
Nov 26, 2012
325
20
0
If you are porting to other device, please make sure in GlobalActions$99.smali whether Landroid/content/context has the same access$xx as same in GlobalActions.smali or change it to be like the one in GlobalActions.smali
Also make sure the following ids in GlobalActions$99.smali are pointed to the correct ids in framework-res.apk:
0x104000a = 0x0104000a = "string" name="ok"
0x104 = 0x01040000 = "string" name="cancel"
hi @majdinj in the quote above I could you explain a little better than see what value access$xx in GlobalActions.smali because I'm trying to port it to a galaxy s rom advance please