[Samsung Galaxy Fit GT 5670] wilfredcool007:
Hey guys….

I’m back with a new guide

Here we go

First use baksmali tool and decompile services.jar and u would find a folder called classout

now navigate to classout\com\android\server

Now open up “PowerManagerService.smali”

search for these two lines

.field static final ANIM_STEPS:I = 0xf
.field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0x3c

And Replace With

.field static final ANIM_STEPS:I = 0xa
.field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0xf

Now Search For

invoke-static {v2, v3, v0}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 2556
const/16 v2, 0xff
goto :goto_e
.end method

And enter paste this code below “.end method”

.method static synthetic getContextZZ(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
.registers 2
.parameter "x0"
.prologue
iget-object v0, p0, Lcom/android/server/PowerManagerService;->mContext:Landroid/content/Context;
return-object v0
.end method

Save the file and now open up “PowerManagerService$BrightnessState”

Now Search For

invoke-static {v0, v1}, Lcom/android/server/PowerManagerService;->access$4700(Lcom/android/server/PowerManagerService;I)I
.line 2295
:cond_2e
return-void
.end method

And paste the following code under “.end method”

.method private getScreenAnimationMode(Landroid/content/Context;)I
.registers 7
.parameter "context"
.prologue
const v0, 0x0
const v3, 0x1
const v4, 0x10
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "config_beam_screen_on"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_22
const v0, 0x1
:goto_18
const-string v2, "config_beam_screen_off"
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-eqz v2, :cond_21
add-int/2addr v0, v4
:cond_21
return v0
:cond_22
const v0, 0x0
goto :goto_18
.end method

Now Search For

.method public run()V
.registers 10
.prologue
const/4 v8, 0x0

And paste this code below “const/4 v8, 0x0”

.line 2078
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->getContextZZ(Lcom/android/server/PowerManagerService;)Landroid/content/Context;
move-result-object v4
invoke-direct {p0, v4}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I
move-result v4
if-nez v4, :cond_3b

Now Find " iget-boolean v4, v4, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z"

There r alot of codes to be changed hence i would post the unmodded and the modded file(CHANGES WOULD BE IN BOLD) so it would be easy for u to find the difference :D :P

Unmodded File:

iget-boolean v4, v4, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z

if-eqz v4, :cond_2f

.line 2299
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;

move-result-object v4

monitor-enter v4

.line 2300
:try_start_e
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

move-result-wide v2

.line 2301
.local v2, now:J
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4800(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;

move-result-object v5

invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->stepLocked()Z

move-result v1

.line 2302
.local v1, more:Z
if-eqz v1, :cond_2a

.line 2303
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$1800(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;

move-result-object v5

const-wide/16 v6, 0x10

add-long/2addr v6, v2

invoke-virtual {v5, p0, v6, v7}, Landroid/os/Handler;->postAtTime(Ljava/lang/Runnable;J)Z

.line 2305
:cond_2a
monitor-exit v4

.line 2320
.end local v1 #more:Z
.end local v2 #now:J
:goto_2b
return-void

.line 2305
:catchall_2c
move-exception v5

monitor-exit v4
:try_end_2e
.catchall {:try_start_e .. :try_end_2e} :catchall_2c

throw v5

.line 2307
:cond_2f
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;

move-result-object v4

monitor-enter v4

.line 2309
:try_start_36
iget-boolean v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->animating:Z

if-eqz v5, :cond_5f

iget v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->targetValue:I

if-nez v5, :cond_5f

const/4 v5, 0x1

move v0, v5

.line 2310
.local v0, animate:Z
:goto_40
if-eqz v0, :cond_51

.line 2313
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$4600(Lcom/android/server/PowerManagerService;)I

move-result v6

const/4 v7, 0x4

if-ne v6, v7, :cond_61

move v6, v8

:goto_4e
invoke-static {v5, v6}, Lcom/android/server/PowerManagerService;->access$4900(Lcom/android/server/PowerManagerService;I)V

.line 2317
:cond_51
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4800(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;

move-result-object v5

invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V

.line 2318
monitor-exit v4

goto :goto_2b

.end local v0 #animate:Z
:catchall_5c
move-exception v5

monitor-exit v4
:try_end_5e
.catchall {:try_start_36 .. :try_end_5e} :catchall_5c

throw v5

:cond_5f
move v0, v8

.line 2309
goto :goto_40

.line 2313
.restart local v0 #animate:Z
:cond_61
:try_start_61
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$1700(Lcom/android/server/PowerManagerService;)I
:try_end_66
.catchall {:try_start_61 .. :try_end_66} :catchall_5c

move-result v6

goto :goto_4e

Modded:

iget-boolean v4, v4, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z

if-eqz v4, [B]:cond_3b[/B]

.line 2079
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;

move-result-object v4

monitor-enter v4

.line 2080
[B]:try_start_1a[/B]
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

move-result-wide v2

.line 2081
.local v2, now:J
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4800(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;

move-result-object v5

invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->stepLocked()Z

move-result v1

.line 2082
.local v1, more:Z
if-eqz v1, [B]:cond_36[/B]

.line 2083
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$1800(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;

move-result-object v5

const-wide/16 v6, 0x10

add-long/2addr v6, v2

invoke-virtual {v5, p0, v6, v7}, Landroid/os/Handler;->postAtTime(Ljava/lang/Runnable;J)Z

.line 2085
[B]:cond_36[/B]
monitor-exit v4

.line 2100
.end local v1 #more:Z
.end local v2 #now:J
[B] :goto_37[/B]
return-void

.line 2085
[B] :catchall_38[/B]
move-exception v5

monitor-exit v4
[B] :try_end_3a
.catchall {:try_start_1a .. :try_end_3a} :catchall_38[/B]

throw v5

.line 2087
[B] :cond_3b[/B]
iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;

move-result-object v4

monitor-enter v4

.line 2089
[B] :try_start_42[/B]
iget-boolean v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->animating:Z

if-eqz v5, [B]:cond_6b[/B]

iget v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->targetValue:I

if-nez v5, [B]:cond_6b[/B]

const/4 v5, 0x1

move v0, v5

.line 2090
.local v0, animate:Z
[B] :goto_4c
if-eqz v0, :cond_5d[/B]

.line 2093
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$4600(Lcom/android/server/PowerManagerService;)I

move-result v6

const/4 v7, 0x4

if-ne v6, v7, [B]:cond_6d[/B]

move v6, v8

[B] :goto_5a[/B]
invoke-static {v5, v6}, Lcom/android/server/PowerManagerService;->access$4900(Lcom/android/server/PowerManagerService;I)V

.line 2097
[B]:cond_5d[/B]
iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4800(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;

move-result-object v5

invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V

.line 2098
monitor-exit v4

[B] goto :goto_37[/B]

.end local v0 #animate:Z
[B]:catchall_68[/B]
move-exception v5

monitor-exit v4
[B]:try_end_6a
.catchall {:try_start_42 .. :try_end_6a} :catchall_68[/B]

throw v5

[B] :cond_6b[/B]
move v0, v8

.line 2089
[B]goto :goto_4c[/B]

.line 2093
.restart local v0 #animate:Z
[B] :cond_6d
:try_start_6d[/B]
iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$1700(Lcom/android/server/PowerManagerService;)I
[B] :try_end_72
.catchall {:try_start_6d .. :try_end_72} :catchall_68[/B]

[B]move-result v6

iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;

invoke-static {v6}, Lcom/android/server/PowerManagerService;->getContextZZ(Lcom/android/server/PowerManagerService;)Landroid/content/Context;

move-result-object v6

invoke-direct {p0, v6}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I

move-result v6

goto :goto_5a[/B]

Save the file and using baksmali tool encrypt it back into classes.dex

Replace the classes.dex in ur services'jar with the newly created classes.dex

[B]Note:[/B]
Make changes in the line numbers (ex:.line 2098,.line2083) according to the order the lines organized in ur smali

Credits:

Vishwanath Patil

Whitehawkx