# [DEV] Enabling CRT ON & OFF Animation in Roms [HOW-TO]



## Whitehawkx

Hello everyone! We all know and love the CRT on and off animation that is Gingerbread's trademark, but unfortunately we don't have this awesome feature in a lot of the manufacturer's stock roms that get released to the public. Some know how to enable the CRT OFF animation with little work, but if you're like me you don't want just one no you want the whole damn package. Well, I'm about to show you how to get just that.

This guide does assume you are familiar with decompiling jars and apks. There are many guides on this should you need more information. This guide is not perfect and will probably need some revising to be made more clear. If you have any suggestions please feel free to let me know. Thanks!

*DO NOT PM ME WITH QUESTIONS! Instead, post in this thread so we can all learn together. If you have a question chances are somebody else will have the same one. Let's answer these for everyone.*

First, let's start with the framework-res.apk

This is the easy part. Decompile the framework-res apk for the rom you wish to modify. Now navigate to the /res/values/bools.xml and open the xml in your preferred text editor.

Now look for this line


Code:


<br />
<bool name="config_animateScreenLights">true</bool><br />

Now you need to change true to false. Now compile your framework-res.apk if you had to change it (and don't forget to delete the resources.arsc in the keep folder!).

Now for the hard part. You need to decompile the classes.dex inside the SERVICES.jar. Navigate to /com/android/server/PowerManagerService.smali and open with text editor.

Now you need to add this method VERBATIM to the smali if it is not already present. Add it in just above the method "getPreferredBrightness()I"



Code:


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

Now to be honest I'm not 100% sure this part is necessary, but this is what I did so you should do it too. You need to alter a few values that are at the TOP portion of PowerManagerService.smali. Make sure yours matches this stuff listed below.



Code:


<br />
.field private static final ALL_BRIGHT:I = 0xf<br />




Code:


<br />
.field static final ANIM_STEPS:I = 0xa<br />




Code:


<br />
.field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0xf<br />




Code:


<br />
.field private static final LIGHT_SENSOR_DELAY:I = 0x7d0<br />




Code:


<br />
.field private static final [URL=mDebugLightSensor:Z]mDebugLightSensor:Z[/URL] = true<br />




Code:


<br />
.field private static final [URL=mDebugProximitySensor:Z]mDebugProximitySensor:Z[/URL] = true<br />

Everything match how mine is above? Ok good! Now save the PowerManagerService.smali.

Still with me? Hang on cause we're almost done!

Now we need to edit one last smali. I suppose this one is the hardest, but it's really not if you follow closely. Open the PowerManagerService$BrightnessState.smali. Add the following method in VERBATIM above "# virtual methods"



Code:


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

One more method, but this one requires some attention. The easiest way I've found is to copy this entire method and paste it in to replace your current one. The problem is all the "access$###" are not going to match up properly. So you will need to fix them to match the ones in your PowerManagerService.smali. I have took the liberty of calling these spots out. All you need to do is do a search for them in your PowerManagerService file and replace the word with the access$### given. Here, it will make more sense as we do it.



Code:


<br />
.method public run()V<br />
	.registers 10<br />
<br />
	.prologue<br />
	const/4 v8, 0x0<br />
<br />
	.line 2076<br />
	iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v4}, Lcom/android/server/PowerManagerService;->getContextZZ(Lcom/android/server/PowerManagerService;)Landroid/content/Context;<br />
<br />
	move-result-object v4<br />
<br />
	invoke-direct {p0, v4}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I<br />
<br />
	move-result v4<br />
<br />
	if-nez v4, :cond_3b<br />
<br />
	iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	iget-boolean v4, v4, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z<br />
<br />
	if-eqz v4, :cond_3b<br />
<br />
	.line 2077<br />
	iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;<br />
<br />
	move-result-object v4<br />
<br />
	monitor-enter v4<br />
<br />
	.line 2078<br />
	:try_start_1a<br />
	invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J<br />
<br />
	move-result-wide v2<br />
<br />
	.line 2079<br />
	.local v2, now:J<br />
	iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;<br />
<br />
	move-result-object v5<br />
<br />
	invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->stepLocked()Z<br />
<br />
	move-result v1<br />
<br />
	.line 2080<br />
	.local v1, more:Z<br />
	if-eqz v1, :cond_36<br />
<br />
	.line 2081<br />
	iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$1800(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;<br />
<br />
	move-result-object v5<br />
<br />
	const-wide/16 v6, 0x10<br />
<br />
	add-long/2addr v6, v2<br />
<br />
	invoke-virtual {v5, p0, v6, v7}, Landroid/os/Handler;->postAtTime(Ljava/lang/Runnable;J)Z<br />
<br />
	.line 2083<br />
	:cond_36<br />
	monitor-exit v4<br />
<br />
	.line 2098<br />
	.end local v1		   #more:Z<br />
	.end local v2		   #now:J<br />
	:goto_37<br />
	return-void<br />
<br />
	.line 2083<br />
	:catchall_38<br />
	move-exception v5<br />
<br />
	monitor-exit v4<br />
	:try_end_3a<br />
	.catchall {:try_start_1a .. :try_end_3a} :catchall_38<br />
<br />
	throw v5<br />
<br />
	.line 2085<br />
	:cond_3b<br />
	iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;<br />
<br />
	move-result-object v4<br />
<br />
	monitor-enter v4<br />
<br />
	.line 2087<br />
	:try_start_42<br />
	iget-boolean v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->animating:Z<br />
<br />
	if-eqz v5, :cond_6b<br />
<br />
	iget v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->targetValue:I<br />
<br />
	if-nez v5, :cond_6b<br />
<br />
	const/4 v5, 0x1<br />
<br />
	move v0, v5<br />
<br />
	.line 2088<br />
	.local v0, animate:Z<br />
	:goto_4c<br />
	if-eqz v0, :cond_5d<br />
<br />
	.line 2091<br />
	iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerService;)I<br />
<br />
	move-result v6<br />
<br />
	const/4 v7, 0x4<br />
<br />
	if-ne v6, v7, :cond_6d<br />
<br />
	move v6, v8<br />
<br />
	:goto_5a<br />
	invoke-static {v5, v6}, Lcom/android/server/PowerManagerService;->access$4600(Lcom/android/server/PowerManagerService;I)V<br />
<br />
	.line 2095<br />
	:cond_5d<br />
	iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;<br />
<br />
	move-result-object v5<br />
<br />
	invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V<br />
<br />
	.line 2096<br />
	monitor-exit v4<br />
<br />
	goto :goto_37<br />
<br />
	.end local v0		   #animate:Z<br />
	:catchall_68<br />
	move-exception v5<br />
<br />
	monitor-exit v4<br />
	:try_end_6a<br />
	.catchall {:try_start_42 .. :try_end_6a} :catchall_68<br />
<br />
	throw v5<br />
<br />
	:cond_6b<br />
	move v0, v8<br />
<br />
	.line 2087<br />
	goto :goto_4c<br />
<br />
	.line 2091<br />
	.restart local v0	   #animate:Z<br />
	:cond_6d<br />
	:try_start_6d<br />
	iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$1700(Lcom/android/server/PowerManagerService;)I<br />
	:try_end_72<br />
	.catchall {:try_start_6d .. :try_end_72} :catchall_68<br />
<br />
	move-result v6<br />
<br />
	iget-object v6, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;<br />
<br />
	invoke-static {v6}, Lcom/android/server/PowerManagerService;->getContextZZ(Lcom/android/server/PowerManagerService;)Landroid/content/Context;<br />
<br />
	move-result-object v6<br />
<br />
	invoke-direct {p0, v6}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/Context;)I<br />
<br />
	move-result v6<br />
<br />
	goto :goto_5a<br />
.end method<br />

Take the above method and paste it into a blank word document. Now search it for "access$500" Ok found it? The line will look exactly like this


Code:


<br />
Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;<br />

See how at the end of that line it says "PowerManagerService$Locklist" ?? Now go look at your PowerManagerService.smali and search it for "access$500" when you find it make sure it reads


Code:


<br />
access$500(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$LockList;<br />

See how access$500 = PowerManagerService$Locklist? You want to make sure that it's correct. If access$500 does not match Service$Locklist you will need to find the one that does. Chances are this one will match so you will be good, but lets say it was access$600 that matched Service.Locklist. Then you would need to go back to the method you are planning to copy into the PowerManagerService$BrightnessState.smali and change "access$500" to "access$600" Again, this one will probably not need to be changed.

The key is to go through this method and replace all the access$### with the one that matches the SERVICE it's calling out. This requires going back and forth between the PowerManagerService$BrightnessState.smali and the PowerManagerService.smali. Once you have all the access$###'s replaced with the correct ones paste the entire method in and REPLACE the one you already have in there. After that, you are finished.

Now compile your services.jar and move it to /system/framework, make sure permissions are set to rw-r--r-- and reboot. When your phone comes back you will have working CRT ON and OFF animation. If your phone gets stuck in boot loop or crashes when sleeping/waking screen then something was done wrong. You will need to run a logcat to determine what exactly.


----------



## Bl4ckpheniX

Thank you for this bud! Very excited to get this going. I bet you had a couple face palms figuring this one out.

Sent from my SGH-T959V using Black RootzWiki Forums


----------



## Webst3r

I believe those extra steps will get CRT to work on Sense devices. My guide on my blog here on the site, doesn't cover those, and for the CRT animation to work you just need to edit bool. (At least that is what has worked on most devices.)


----------



## Whitehawkx

Webst3r said:


> I believe those extra steps will get CRT to work on Sense devices. My guide on my blog here on the site, doesn't cover those, and for the CRT animation to work you just need to edit bool. (At least that is what has worked on most devices.)


True, but editing the bool only enables the CRT OFF animation. It doesn't do both. This is how I was able to enable both the off and ON animations. The extra steps are only necessary if you want the ON portion of the animation as well. ^^

This is confirmed working on G2x and Vibrant. I imagine it should work on most devices out there.


----------



## religi0n

I went through this tutorial meticulously. Everything checked out, but then when I went to put it on my phone, I got everything there and now when I hit the power button it only locks, the screen does not go off at all.

EDIT: I am on Droid X2. I tried it again without changing the .field static values that you said might not be necessary, and no difference. When the lock button is pushed, the screen gets bright, and locks. The display stays on.


----------



## LeeDrOiD

Hi WhitehawkX not sure if you have heard of me, I am a developer over on the XDA forums.

Just registered when I found your post, I am trying to find a viable patch for CRT as our current method messes up wakelocks & autobrightness, I have attempted your method but it fails for me with the below error, resulting in a system freeze.



Code:


E/AndroidRuntime(  633): java.lang.NoSuchMethodError: com.android.server.PowerManagerService$BrightnessState.getScreenAnimationMode

Any chance you could take a look at the current PowerManagerService.smali and PowerManagerService$BrightnessState.smali and see if you can come up with a fix? Taken from the new HTC Sensation 2.3.4 build

would be more than happy to throw you a few beers in return 

PowerManagerService$BrightnessState.smali http://pastebin.com/ejb9TBpw

PowerManagerService.smali http://pastebin.com/H4fgVFsH


----------



## Whitehawkx

religi0n said:


> I went through this tutorial meticulously. Everything checked out, but then when I went to put it on my phone, I got everything there and now when I hit the power button it only locks, the screen does not go off at all.
> 
> EDIT: I am on Droid X2. I tried it again without changing the .field static values that you said might not be necessary, and no difference. When the lock button is pushed, the screen gets bright, and locks. The display stays on.


Try running a logcat to see if it shows any errors when you lock your phone. I had to run logcats back in forth for awhile to get this to work the first time. Also, just to be sure, in your framework-res the bool is set to "true" correct?


----------



## Whitehawkx

LeeDrOiD said:


> Hi WhitehawkX not sure if you have heard of me, I am a developer over on the XDA forums.
> 
> Just registered when I found your post, I am trying to find a viable patch for CRT as our current method messes up wakelocks & autobrightness, I have attempted your method but it fails for me with the below error, resulting in a system freeze.
> 
> 
> 
> Code:
> 
> 
> E/AndroidRuntime(  633): java.lang.NoSuchMethodError: com.android.server.PowerManagerService$BrightnessState.getScreenAnimationMode
> 
> Any chance you could take a look at the current PowerManagerService.smali and PowerManagerService$BrightnessState.smali and see if you can come up with a fix? Taken from the new HTC Sensation 2.3.4 build
> 
> would be more than happy to throw you a few beers in return
> 
> PowerManagerService$BrightnessState.smali http://pastebin.com/ejb9TBpw
> 
> PowerManagerService.smali http://pastebin.com/H4fgVFsH


The logcat error is showing that it can't find the method for "getScreenAnimationMode" in the "PowerManagerService$BrightnessState.smali." I checked yours and sure enough that method is missing. That method is listed above in the tutorial and needs to be added verbatim to the PowerManagerService$BrightnessState.smali. I copied that method in and placed it just ABOVE where it says "# virtual methods"

I'll add the method here again just to be clear.


Code:


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

Put that in and see if it works after that. :wink2:


----------



## roman

LeeDrOiD said:


> Hi WhitehawkX not sure if you have heard of me, I am a developer over on the XDA forums.
> 
> Just registered when I found your post, I am trying to find a viable patch for CRT as our current method messes up wakelocks & autobrightness, I have attempted your method but it fails for me with the below error, resulting in a system freeze.
> 
> 
> 
> Code:
> 
> 
> E/AndroidRuntime(  633): java.lang.NoSuchMethodError: com.android.server.PowerManagerService$BrightnessState.getScreenAnimationMode
> 
> Any chance you could take a look at the current PowerManagerService.smali and PowerManagerService$BrightnessState.smali and see if you can come up with a fix? Taken from the new HTC Sensation 2.3.4 build
> 
> would be more than happy to throw you a few beers in return
> 
> PowerManagerService$BrightnessState.smali http://pastebin.com/ejb9TBpw
> 
> PowerManagerService.smali http://pastebin.com/H4fgVFsH


Hey Lee,

I'm birgertime over on XDA--

I'm also trying to get it to work (working off the 2.3.4 leak), but I'm porting over CM7 code so we can make it on/off toggle-able. I'll post up my code once I get it working. Been trying to get this for nearly 6 hours now. Damn smali.


----------



## LeeDrOiD

Thanks! I was using the 2nd method, il give it a blast now and try again :wink2:


----------



## Whitehawkx

LeeDrOiD said:


> Thanks! I was using the 2nd method, il give it a blast now and try again :wink2:


Yea the are BOTH needed for it to work. I'm betting adding in that method should be the last thing needed. Please report back if you get it working. ^^


----------



## LeeDrOiD

roman said:


> Hey Lee,
> 
> I'm birgertime over on XDA--
> 
> I'm also trying to get it to work (working off the 2.3.4 leak), but I'm porting over CM7 code so we can make it on/off toggle-able. I'll post up my code once I get it working. Been trying to get this for nearly 6 hours now. Damn smali.


Ha.. Hi mate, yes its a pain in the a#@! I had thought about the toggle my self, should not be too difficult imo.

@Whithawkx > Clearly misread that one in my haste!


----------



## religi0n

Whitehawkx said:


> Try running a logcat to see if it shows any errors when you lock your phone. I had to run logcats back in forth for awhile to get this to work the first time. Also, just to be sure, in your framework-res the bool is set to "true" correct?


Yes, my CURRENT framework-res is at true, so I have no effect as of now (that is how I originally enabled the effect on the X2 over at XDA). I will run a logcat with my modified services.jar, and see what I can come up with...I am no experienced dev, so I doubt I will be able to do much with it on my own.

Off topic: LeeDroid, I love your ROM. I do not use it myself, but I loaded it into my girlfriends phone and she loves it. Great work you have done.

EDIT: I logged while pushing the lock button a few times. This was a relevant looking part of the log.
http://pastebin.com/Tupj8487


----------



## LeeDrOiD

Whitehawkx mind popping your 2 powermanager smalis on pastebin so I can compare? All aok but still no CRT, wondering what the differences are


----------



## Sonicfreak360

Uhh... my framework doesn't have a value folder or a bools.xml! I'm sure it's gingerbread though, 2.3.2

I'm on the sony Ericsson Xperia Play R800x

Sent from my R800x using Tapatalk


----------



## nickiberli

You first have to decompile the framework-res.apk otherwise you can't see that folder.


----------



## Sonicfreak360

nickiberli said:


> You first have to decompile the framework-res.apk otherwise you can't see that folder.


I guess I didn't decompile it right. What do you guys use to decompile?

Sent from my R800x using Tapatalk


----------



## Whitehawkx

Here are the smali in my builds.

G2x
PowerManagerService - http://pastebin.com/afvbdWRu
PowerManagerService$BrightnessState - http://pastebin.com/863NHT33

Vibrant
PowerManagerService - http://pastebin.com/hxbca9f1
PowerManagerService$BrightnessState - http://pastebin.com/3v07NqWN

And of course I have the bool for "animateScreenLights" set to TRUE.


----------



## LeeDrOiD

Whitehawkx said:


> Here are the smali in my builds.
> 
> G2x
> PowerManagerService - http://pastebin.com/afvbdWRu
> PowerManagerService$BrightnessState - http://pastebin.com/863NHT33
> 
> Vibrant
> PowerManagerService - http://pastebin.com/hxbca9f1
> PowerManagerService$BrightnessState - http://pastebin.com/3v07NqWN
> 
> And of course I have the bool for "animateScreenLights" set to TRUE.


Thanks mate, had a breif look and there are a lot of differences in the sensation smalis, will see what I can come up with


----------



## roman

For the Sensation, I've narrowed it down to the brightness code and how they handle it in PowerManagerService.smali

I added some debugging code, and the run() method only gets called when autobrightness is ON AND when the screen turns on. Otherwise it doesn't run.

I feel like I know these smalis on the back of my hand now, so I think I'm going to start over from the fresh 2.3.4 services.jar and work from it.


----------



## Enes_81

Hi, I own a HTC Incredible S 
I tried to follow your steps but I just can't getting it to work.

So I am hoping someone can help me by doing it for me 

*PowerManagerService.smali *
http://db.tt/Qi0ufWS

*PowerManagerService$BrightnessState.smali *
http://db.tt/bdCHpkv


----------



## sac23

can u let us know when u get it on 2.3.4 ive tryed all i could just cant get it to go

evo 3d

thanks


----------



## Br1cK'd

Damn Hawkx, you're still big pimpin!


----------



## religi0n

I was able to get the screen to lock, but it is an instant off, no animation at all.

I have found some interesting things in logcat, but I don't know where to go from here.

http://pastebin.com/DF4bjRDa

Can someone look at this for me?


----------



## Enes_81

> Once you have all the access$###'s replaced with the correct ones *paste the entire method in and REPLACE the one you already have in there.* After that, you are finished.


What to you mean with this?? Replace what? Do I have to delete some code in PowerManagerService$BrightnessState.smali ??


----------



## MENNENN

Tried all possible ways. On Desire S no CRT effect. :tongue3:


----------



## KMDonlon

This worked perfectly for me, thanks so much for posting the tutorial!!

*EDIT:* I also wanted to mention that when you copy and past the smali edits posted in the OP, you need to fix all the indents as well as remove all the spaces from the end of each line of the code. I used notepad+++. I can certainly help if anyone is still having trouble. Lastly, the first boot takes extremely long but don't panic.


----------



## cordell

I am fighting the de-compiling of classes.dex. I have tried every tool know to the interwebz with no luck







The sure fire one that was supposed to make this easy is *djdec312*, complete with a GUI and all. I drag/drop the services.jar into the Prog and it opens and when I try to de-compile it errors out. If anybody can give me a shove in the right direction I would appreciate it! Linking my classes.dex as that may be the problem???

http://www.megaupload.com/?d=SW21RCIK


----------



## imnuts

Thanks for this









Also, making the ANIM_STEPS:I 0xf as opposed to 0xa smooths out the animation a little bit (not much) and makes the on animation easier to see.


----------



## KMDonlon

Will give it a try, thanks for the tip imnuts


----------



## shoman94

Roman or whitehawkx;

I enabled this feature but the images are upside down during animation. So at time when it comes out standby the image stays upside down until I rotate the phone. You have any insight for me on this? BTW.... I"m using an at&t SGS2


----------



## StDevious

Not sure what you mean when you say "and don't forget to delete the resources.arsc in the keep folder". I'm using apk manager 5 on ubuntu to decompile and I don't see a keep folder in the decompiled folder.

AND does this work on Honeycomb 3.2.1 ?


----------



## pirateghost

curious to what the config_animateScreenLights is actually supposed to be. in the first post you indicate that it must be set to false, and then later on in the thread you are stating that you have yours set to true?
i would think it would need to be set to true to get the CRT off effect?


----------



## StDevious

followed the directions, tried on HC 3.2.1 on a ROM flashable zip. Recompiled the files like the directions but when I flashed the rom, it was stuck at the boot animation for like 30 mins. Never got to the ROM first time setup screen.

EDIT: Of course I signed the apk's too, not sure if they were required.


----------



## zerok

I'm using a Kyocera Echo (oh noez) and the boot loop I'm stuck in seems to be happening as soon as the boot animation ends. I'm not completely sure why. Any insight into this?


----------



## VHJC

Hi Whitehawkx, I hope you can help me. I'm trying to get the CRT for my ROM but I can't. This is my logcat:

dalvikvm( 333): Could not find method com.android.server.PowerManagerService.access$5300, referenced from method com.android.server.PowerManagerService$BrightnessState.run
dalvikvm( 333): VFY: unable to resolve static method 4578: Lcom/android/server/PowerManagerService;.access$5300 (Lcom/android/server/PowerManagerServiceI
dalvikvm( 333): VFY: replacing opcode 0x71 at 0x0052
dalvikvm( 333): Could not find method com.android.server.PowerManagerService.access$5500, referenced from method com.android.server.PowerManagerService$BrightnessState.run
dalvikvm( 333): VFY: unable to resolve static method 4581: Lcom/android/server/PowerManagerService;.access$5500 (Lcom/android/server/PowerManagerServiceLcom/android/server/PowerManagerService$BrightnessState;
dalvikvm( 333): VFY: replacing opcode 0x71 at 0x005f

AndroidRuntime( 333): *** FATAL EXCEPTION IN SYSTEM PROCESS: PowerManagerService.mScreenOffThread
AndroidRuntime( 333): java.lang.NoSuchMethodError: com.android.server.PowerManagerService.access$5500
AndroidRuntime( 333): at com.android.server.PowerManagerService$BrightnessState.run(PowerManagerService.java:2095)
AndroidRuntime( 333): at android.os.Handler.handleCallback(Handler.java:587)
AndroidRuntime( 333): at android.os.Handler.dispatchMessage(Handler.java:92)
AndroidRuntime( 333): at android.os.Looper.loop(Looper.java:150)
AndroidRuntime( 333): at android.os.HandlerThread.run(HandlerThread.java:60)

And here are my smali files:

PowerManagerService.smali	http://pastebin.com/BqjEjW35
PowerManagerService$BrightnessState.smali	http://pastebin.com/TLADdTME

Could you take a look and tell me where I am wrong please?

TIA!


----------



## chingy51o

anyone know how to speed up the animation? i got it working on the htc rezound but the animation is EXTREMELY slow...


----------



## shoman94

pirateghost said:


> curious to what the config_animateScreenLights is actually supposed to be. in the first post you indicate that it must be set to false, and then later on in the thread you are stating that you have yours set to true?
> i would think it would need to be set to true to get the CRT off effect?


False sets the crt off effect...... I know opposite of what makes sense.


----------



## [email protected]

My classes.dex doesn't have PowerManagerService.smali it has PowerManagerService.class, which obviously is not simple text...what do I do now?

Thank you.


----------



## Putzschwamm

Hey guys!

@[email protected]: just decompile the sevices.jar and go to: /com/android/server/ there you'll find the smali files.

I've got another problem porting this one to the Galaxy S Plus...

There are three access$####'s inside the modified ".method public run()V" that are not calling a service like "access$500 = PowerManagerService$Locklist" in the example:

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$4300(Lcom/android/server/PowerManagerServiceI

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

invoke-static {v6}, Lcom/android/server/PowerManagerService;->access$1700(Lcom/android/server/PowerManagerServiceI

Could maybe someone explain to me what i'm supposed to do with these 3? Because when debugging with logcat the error message of course says "no such method: access$4300".

Thanks in advance!

Ben


----------



## [email protected]

The deoxed services.jar from my phone does not have .smali files, they all are .class


----------



## Putzschwamm

@ [email protected]:
did you decompile it with the apktool? the tool created one folder called "smali" and one file called "apktool.yml". the smali folder contains all the files...








if it doesn't work for you, upload the service.jar somewhere and i'll decompile it for you and reupload it as a zip file...

But back to my problem









I can't get working...

Logcat still keeps putting out this error:



Code:


<br />
D/PowerManagerService( 5606): goToSleepWithReason : time : 621876 reason : 2<br />
D/PowerManagerService( 5606): setting mProxIgnoredBecauseScreenTurnedOff<br />
I/PowerManagerService( 5606): Ulight 3->0|0<br />
W/dalvikvm( 5606): threadid=16: thread exiting with uncaught exception (group=0x4001d560)<br />
E/		( 5606): Dumpstate > mpstate_sys_error.log<br />
E/AndroidRuntime( 5606): *** FATAL EXCEPTION IN SYSTEM PROCESS: PowerManagerService.mScreenOffThread<br />
E/AndroidRuntime( 5606): java.lang.NoSuchMethodError: com.android.server.PowerManagerService.access$4300<br />
E/AndroidRuntime( 5606):		at com.android.server.PowerManagerService$BrightnessState.run(PowerManagerService.java:2091)<br />
E/AndroidRuntime( 5606):		at android.os.Handler.handleCallback(Handler.java:587)<br />
E/AndroidRuntime( 5606):		at android.os.Handler.dispatchMessage(Handler.java:92)<br />
E/AndroidRuntime( 5606):		at android.os.Looper.loop(Looper.java:130)<br />
E/AndroidRuntime( 5606):		at android.os.HandlerThread.run(HandlerThread.java:60)<br />

This happens when the screen is turned off, before everything is fine.
If someone could have a look on my code here and help me, i would be really glad:

PowerManagerService.smali: http://pastebin.com/LvwEExhd
PowerManagerService$BrightnessState.smali: http://pastebin.com/BEkDgs3x
Only the changed ".method public run()V"*:* http://pastebin.com/n1DVVaYz

Please tell me If you need more log infos.

Thank you very much

EDIT:
The problem seems to be that there's no "access$4300" in the PowerManagerService.smali. But i don't know for what i have to search as there is no service called with access$4300 in the modified method inside the PowerManagerService$BrightnessState.smali.

Or maybe I'm completely wrong...!?!


----------



## [email protected]

Putzschwamm said:


> @ [email protected]:
> did you decompile it with the apktool? the tool created one folder called "smali" and one file called "apktool.yml". the smali folder contains all the files...


DOH!
I didn't know apktool can do that...I went straight to google search how to decompile .jar..
Thanks.

Now a quick question, before I continue and brick my phone. The current rom I'm using (stock) is not deoxed, will it work if I just replace deoxed and modified services.jar and remove services.odex ?

[EDIT]
Do I need modify these to match as per instructions?


Code:


.field static final ANIM_STEPS:I = 0xf<br />
.field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0x3c<br />
.field private static final LIGHT_SENSOR_DELAY:I = 0x3e8<br />


----------



## Putzschwamm

As long as you have installed CWM and made a full nandroid backup before applying the changes you will not brick your phone. You can always restore your old services.jar by doing a restore of /system via CWM.

I can not say if you need a deodexed services.jar do make this mod work but i think so. I also had bootloop troubles when i tried to modify the framework-res.apk when it was not deodexed. So I went ahead and deodexed my rom. After that the CRT OFF worked like charm.
The CRT ON is another story, for me I am stuck until I know what to do with my "access$4300" as mentioned in the post above...









But at the end i would advice you to deodex your rom to mod these system files.



> Do I need modify these to match as per instructions?
> 
> 
> Code:
> 
> 
> .field static final ANIM_STEPS:I = 0xf<br />
> .field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0x3c<br />
> .field private static final LIGHT_SENSOR_DELAY:I = 0x3e8<br />


I think yes. Just have a try following the guide and maybe make one version with and one without these .field changes and try them.


----------



## mjgreenjr

Putzschwamm said:


> The CRT ON is another story, for me I am stuck until I know what to do with my "access$4300" as mentioned in the post above...


If you're still stuck on this, what I did was step through line by line with the original function and the one we're supposed to replace it with and every place there was an "access$####" I used the numbers from the original. I'm not showing any errors in logcat. I'm also not seeing either animation, but it doesn't appear to be caused by any errors so I think I got all the functions named correctly.

Anyone done this on a HTC Vivid? I've seen a couple rom's that have it but I kind of like the rom I'm using already. I just want to tweak this one last thing (for now).


----------



## TinTin

Hey guys!
sorry for asking this question, but how can I find these files "classes.dex" "SERVICES.jar" "PowerManagerService$BrightnessState.smali" to edit them?
don't let me down, Help me up!


----------



## jeepinwk

Have been trying to make this work for 2 days now and I am hoping someone can point me in the right direction.
I have HTC Incredible, with S-off with the most recent completely stock OTA...... I am however rooted, with some minor graphics modifications.
Using apktool I decompiled framwork-res and found everything as described (I am a little confused whether I want screen lights true or false... default is false so I made true.)
Anyways, that having been said, the problem I am running into is when I decompile my services.jar, It appears to be completely empty. I do not think I am decompiling wrong because if I try the same with other roms there are files present.
Can anybody point me in the right direction or tell me what I am doing wrong?

to above post tintin.... use a file explorer on you phone and go /system/framework/ in there you should find both the framework-res.apk and the services.jar. Copy both to to your computer and use the apktool to decompile. classes.dex and powermanagerservice files SHOULD be in there as I have found on other ROMs. If it is not then you are prob stuck the same place as me. good luck


----------



## TinTin

Thank you man. you are the guy


----------



## blaster44

Hi!

I'm using HTC magic. I have working this animation, but it's slowly. Where can I speed up this? This is possible?


----------



## stupid

Is this going to work with andriod 4 ICS? I looked around and I don't think anyones got it.


----------



## Robobob

done!


----------



## shane6374

Would someone be able to clarify the last step of the OP? So lost!


----------



## adri_360

Not working for me, i have a Optimus 3D with GB 2.3.5.

Mix Acura-Samno


----------



## shahabazas

can anyone help me as if i tried it and got OFF working but when i tried to get the ON working phone stuck on Boot animation so i m attaching the files here if anyone can edit them and provide me the correct file i am using Micromax A75 having Android 2.3.4


----------



## adri_360

shahabazas said:


> can anyone help me as if i tried it and got OFF working but when i tried to get the ON working phone stuck on Boot animation so i m attaching the files here if anyone can edit them and provide me the correct file i am using Micromax A75 having Android 2.3.4


framework-res is bad compile or srvices.jar is bad compile

Mix Acura-Samno


----------



## jayjay1o1

Umm, Yea, I'm sort of a noob, so will someone sort of break this process down for me?


----------



## razorloves

jayjay1o1 said:


> Umm, Yea, I'm sort of a noob, so will someone sort of break this process down for me?


it's broken down pretty good in the op. if you dont understand a step, google it. if you still need help on a particular step, ask here.


----------



## 1982Strand

To make things easier, you can remove all the ".line xxx" -lines from the smalis. Using the line numbers from the op just gives problems, as they most likey don't match everyone elses. I believe they're built up again automatically when recompiling, so they match the java files. (Not 100% sure how it works though..)
I have been working with MIUI patchrom and have patched tons of smalis, where things got a whole lot easier when removing those ".line xxxx" entries. And no problems when they got removed  You can find the script (linux) rmline on their github site github.com/Micode, this will do the whole process automatically










I didn't do this mod yet myself, but i'll probably give it a go...


----------



## adizz

There is no /res/values folder in my framework-res.apk.
Stock ICS on pantech p9070.


----------



## mrznaboya

Greetings Whitehawkx,

I'm just a noob end-user but I was able to follow your instructions. After I recompiled the services.jar, moved it to /system/framework, made sure permissions are set to rw-r--r-- and rebooted the phone, the CRT ON animation doesn't work, like, it's still the normal ON animation. Any chance you could take a look at the current PowerManagerService.smali and PowerManagerService$BrightnessState.smali and see what's going on?

Million Thanks for the guide, by the way. 

[background=rgb(245, 245, 245)]PowerManagerService.smali [/background]http://pastebin.com/2gdtyDUf
[background=rgb(245, 245, 245)]PowerManagerService$BrightnessState.smali [/background]http://pastebin.com/5u3JyW0E

Just to add:
I believe I've matched all the "access$###" in PowerManagerService$BrightnessState.smali with the ones in PowerManagerService.smali.

Here are all the "access$###" on both files. Looks to me everything matched.
http://pastebin.com/h2YN7k3s

EDIT:
I also noticed that my battery empty estimation dropped down to 14hrs(which is bad) but when I restored my backup it went back 24hrs(which is good :3).


----------



## HerbieVersmelz

adizz said:


> There is no /res/values folder in my framework-res.apk.
> Stock ICS on pantech p9070.


most likely because you have not decompiled it

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Jaspreet_Singh

Whitehawkx said:


> Hello everyone! We all know and love the CRT on and off animation that is Gingerbread's trademark, but unfortunately we don't have this awesome feature in a lot of the manufacturer's stock roms that get released to the public. Some know how to enable the CRT OFF animation with little work, but if you're like me you don't want just one no you want the whole damn package. Well, I'm about to show you how to get just that.
> 
> This guide does assume you are familiar with decompiling jars and apks. There are many guides on this should you need more information. This guide is not perfect and will probably need some revising to be made more clear. If you have any suggestions please feel free to let me know. Thanks!
> 
> *DO NOT PM ME WITH QUESTIONS! Instead, post in this thread so we can all learn together. If you have a question chances are somebody else will have the same one. Let's answer these for everyone.*
> 
> First, let's start with the framework-res.apk
> 
> This is the easy part. Decompile the framework-res apk for the rom you wish to modify. Now navigate to the /res/values/bools.xml and open the xml in your preferred text editor.
> 
> Now look for this line
> 
> <bool name="config_animateScreenLights">true</bool>
> 
> Now you need to change true to false. Now compile your framework-res.apk if you had to change it (and don't forget to delete the resources.arsc in the keep folder!).
> 
> Now for the hard part. You need to decompile the classes.dex inside the SERVICES.jar. Navigate to /com/android/server/PowerManagerService.smali and open with text editor.
> 
> Now you need to add this method VERBATIM to the smali if it is not already present. Add it in just above the method "getPreferredBrightness()I"
> 
> .method static synthetic getContextZZ(Lcom/android/server/PowerManagerServiceLandroid/content/Context;
> .registers 2
> .parameter "x0"
> 
> .prologue
> iget-object v0, p0, Lcom/android/server/PowerManagerService;->mContext:Landroid/content/Context;
> 
> return-object v0
> .end method
> 
> Now to be honest I'm not 100% sure this part is necessary, but this is what I did so you should do it too. You need to alter a few values that are at the TOP portion of PowerManagerService.smali. Make sure yours matches this stuff listed below.
> 
> .field private static final ALL_BRIGHT:I = 0xf
> 
> .field static final ANIM_STEPS:I = 0xa
> 
> .field static final AUTOBRIGHTNESS_ANIM_STEPS:I = 0xf
> 
> .field private static final LIGHT_SENSOR_DELAY:I = 0x7d0
> 
> .field private static final mDebugLightSensor:Z = true
> 
> .field private static final mDebugProximitySensor:Z = true
> 
> Everything match how mine is above? Ok good! Now save the PowerManagerService.smali.
> 
> Still with me? Hang on cause we're almost done!
> 
> Now we need to edit one last smali. I suppose this one is the hardest, but it's really not if you follow closely. Open the PowerManagerService$BrightnessState.smali. Add the following method in VERBATIM above "# virtual methods"
> 
> .method private getScreenAnimationMode(Landroid/content/ContextI
> .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
> 
> One more method, but this one requires some attention. The easiest way I've found is to copy this entire method and paste it in to replace your current one. The problem is all the "access$###" are not going to match up properly. So you will need to fix them to match the ones in your PowerManagerService.smali. I have took the liberty of calling these spots out. All you need to do is do a search for them in your PowerManagerService file and replace the word with the access$### given. Here, it will make more sense as we do it.
> 
> .method public run()V
> .registers 10
> 
> .prologue
> const/4 v8, 0x0
> 
> .line 2076
> 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/PowerManagerServiceLandroid/content/Context;
> 
> move-result-object v4
> 
> invoke-direct {p0, v4}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/ContextI
> 
> move-result v4
> 
> if-nez v4, :cond_3b
> 
> iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
> 
> iget-boolean v4, v4, Lcom/android/server/PowerManagerService;->mAnimateScreenLights:Z
> 
> if-eqz v4, :cond_3b
> 
> .line 2077
> 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/PowerManagerServiceLcom/android/server/PowerManagerService$LockList;
> 
> move-result-object v4
> 
> monitor-enter v4
> 
> .line 2078
> :try_start_1a
> invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
> 
> move-result-wide v2
> 
> .line 2079
> .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$4500(Lcom/android/server/PowerManagerServiceLcom/android/server/PowerManagerService$BrightnessState;
> 
> move-result-object v5
> 
> invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->stepLocked()Z
> 
> move-result v1
> 
> .line 2080
> .local v1, more:Z
> if-eqz v1, :cond_36
> 
> .line 2081
> 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/PowerManagerServiceLandroid/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 2083
> :cond_36
> monitor-exit v4
> 
> .line 2098
> .end local v1 #more:Z
> .end local v2 #now:J
> :goto_37
> return-void
> 
> .line 2083
> :catchall_38
> move-exception v5
> 
> monitor-exit v4
> :try_end_3a
> .catchall {:try_start_1a .. :try_end_3a} :catchall_38
> 
> throw v5
> 
> .line 2085
> :cond_3b
> 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/PowerManagerServiceLcom/android/server/PowerManagerService$LockList;
> 
> move-result-object v4
> 
> monitor-enter v4
> 
> .line 2087
> :try_start_42
> iget-boolean v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->animating:Z
> 
> if-eqz v5, :cond_6b
> 
> iget v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->targetValue:I
> 
> if-nez v5, :cond_6b
> 
> const/4 v5, 0x1
> 
> move v0, v5
> 
> .line 2088
> .local v0, animate:Z
> :goto_4c
> if-eqz v0, :cond_5d
> 
> .line 2091
> 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$4300(Lcom/android/server/PowerManagerServiceI
> 
> move-result v6
> 
> const/4 v7, 0x4
> 
> if-ne v6, v7, :cond_6d
> 
> move v6, v8
> 
> :goto_5a
> invoke-static {v5, v6}, Lcom/android/server/PowerManagerService;->access$4600(Lcom/android/server/PowerManagerService;I)V
> 
> .line 2095
> :cond_5d
> iget-object v5, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
> 
> invoke-static {v5}, Lcom/android/server/PowerManagerService;->access$4500(Lcom/android/server/PowerManagerServiceLcom/android/server/PowerManagerService$BrightnessState;
> 
> move-result-object v5
> 
> invoke-virtual {v5}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V
> 
> .line 2096
> monitor-exit v4
> 
> goto :goto_37
> 
> .end local v0 #animate:Z
> :catchall_68
> move-exception v5
> 
> monitor-exit v4
> :try_end_6a
> .catchall {:try_start_42 .. :try_end_6a} :catchall_68
> 
> throw v5
> 
> :cond_6b
> move v0, v8
> 
> .line 2087
> goto :goto_4c
> 
> .line 2091
> .restart local v0 #animate:Z
> :cond_6d
> :try_start_6d
> 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/PowerManagerServiceI
> :try_end_72
> .catchall {:try_start_6d .. :try_end_72} :catchall_68
> 
> 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/PowerManagerServiceLandroid/content/Context;
> 
> move-result-object v6
> 
> invoke-direct {p0, v6}, Lcom/android/server/PowerManagerService$BrightnessState;->getScreenAnimationMode(Landroid/content/ContextI
> 
> move-result v6
> 
> goto :goto_5a
> .end method
> 
> Take the above method and paste it into a blank word document. Now search it for "access$500" Ok found it? The line will look exactly like this
> 
> Lcom/android/server/PowerManagerService;->access$500(Lcom/android/server/PowerManagerServiceLcom/android/server/PowerManagerService$LockList;
> 
> See how at the end of that line it says "PowerManagerService$Locklist" ?? Now go look at your PowerManagerService.smali and search it for "access$500" when you find it make sure it reads
> 
> access$500(Lcom/android/server/PowerManagerServiceLcom/android/server/PowerManagerService$LockList;
> 
> See how access$500 = PowerManagerService$Locklist? You want to make sure that it's correct. If access$500 does not match Service$Locklist you will need to find the one that does. Chances are this one will match so you will be good, but lets say it was access$600 that matched Service.Locklist. Then you would need to go back to the method you are planning to copy into the PowerManagerService$BrightnessState.smali and change "access$500" to "access$600" Again, this one will probably not need to be changed.
> 
> The key is to go through this method and replace all the access$### with the one that matches the SERVICE it's calling out. This requires going back and forth between the PowerManagerService$BrightnessState.smali and the PowerManagerService.smali. Once you have all the access$###'s replaced with the correct ones paste the entire method in and REPLACE the one you already have in there. After that, you are finished.
> 
> Now compile your services.jar and move it to /system/framework, make sure permissions are set to rw-r--r-- and reboot. When your phone comes back you will have working CRT ON and OFF animation. If your phone gets stuck in boot loop or crashes when sleeping/waking screen then something was done wrong. You will need to run a logcat to determine what exactly.
> 
> Hi i own galaxy grand quattro gt-i8552
> 
> com/android/server/PowerManagerService$BrightnessState.smali is not present in it
> 
> here my srevices.jar
> 
> http://d-h.st/KOP
> 
> i have compiled my framework-res.apk but u said (delete resources.arsc from keep) what it means ??
> 
> kindly email me if u can if u can edit my services.jar cus i want my rom with crt effect
> 
> email :- [email protected]


----------

