yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] sphinx02:
Ok, I will test the changes in the Java code later! I know how to restore files via adb and I'm experienced in testing files. I also have basics in assembler programming but never heard of objdump, will take a look at it! I can test the modified lib for the s2 on my s3 and I attached the file from the s3..

I am willing to try around as I have the time to and it would be very nice if you can share the changes you made in the lib-file.

Perhaps you can also tell me how to decompile and compile the .so lib file!

Kind regards and thank you for your information!

EDIT: Of course I have already tested the change from animatscreenlights from true to false, but that doesnt work at all!

EDIT: On the SGS1 (and propably on the SGS2) you always had to set the window-animations to all. On the SGS3 there is no option to set these window-animation in the display-settings, perhaps there is the problem, that they are disabled by default and you cant activate them..
[Galaxy S II Themes and Apps] Tungstwenty:
Looking at the file you posted, the S2 library will definitely not work on S3.

There are additional exported symbols on the S3 file, and therefore it's 99% certain they are expected to be there by the other layers that call this. Some examples:

- android::SurfaceTextureLayer::flipExtDisplayFlag(int)

- android::reportFPS(float)

- android::HWComposer::setInformation(int, unsigned int)const

... etc ...

You can try replacing the file if you like, but you might as well start preparing your ADB revert commands in advance :D

Start off by decompiling the class com.android.server.PowerManagerService$SettingsObserver and checking if the update() method modifies the variable mAnimationSetting; plus, check what it uses it for later.

On S2, if you set it to 0x11, it will enable both CRT-Off and CRT-On (provided the library correctly implements it).

The library you attached contains the appropriate entry points for both the effects and the implementation appears to be there. With a bit of luck, on S3 it might just function out of the box provided you change the java/dalvik part. At worst, I'd expect it to contain the same functionality as in S2 (only CRT-Off actually working, and with the occasional flash issue).
[Galaxy S II Themes and Apps] rovo89:
And then there is at least the same situation to start improving from, so we know that applying the same patches will probably result in the same target situation.

In the same Java file (or somewhere very close), there should be a call to startNativeSomething (not near a PC right now so I can't check), which triggers the animation. You can also start checking from this direction and see if it is called and why not.
[Galaxy S II Themes and Apps] Tungstwenty:
I downloaded the ROM and checked, the source is missing precisely that invocation; this line is not being called.

And since the source code is missing that line, there is no synthetic accessor for the private nativeStartSurfaceFlingerAnimation(I)V method, so it can be changed to public in case that's needed by the inner class (I'm not sure whether a synthetic accessor is needed for methods as well)

@sphynx02,

could you try that small addition to the java side? And you might as well put 0x11 instead of the variable mAnimationSetting; the effects will be hard-coded active, but just for experimenting. Also, make sure that mAnimateScreenLights is false, of patch the test as well.
[Galaxy S II Themes and Apps] Tungstwenty:
Try this quick change:

Open PowerManagerService$BrigtnessState.smali

Search for ".line 2679", you should find these instructions (abbreviated here)

.line 2679
:cond_38

iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$6000(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;
move-result-object v4
invoke-virtual {v4}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V

This corresponds to the java instruction:

mScreenBrightness.jumpToTargetLocked();

So, you need to insert some extra lines after ":cond_38" and before invoking jumpToTargetLocked():

.line 2679
:cond_38

[COLOR="Blue"] iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/4 v3, 0x11 # CRT-On and CRT-Off
invoke-direct {v4, v3}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V
[/COLOR]

iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$6000(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;
move-result-object v4
invoke-virtual {v4}, Lcom/android/server/PowerManagerService$BrightnessState;->jumpToTargetLocked()V

Also, in PowerManagerService.smali you might need to change nativeStartSurfaceFlingerAnimation so it's no longer private, but you have to test whether it's needed or not.

Can you do this test?
[Galaxy S II Themes and Apps] sphinx02:
I got following error while recompiling it:

out\com\android\server\PowerManagerService$BrightnessState.smali[403,4] mismatched input 'iget-object' expecting set null

I thought about its wrong to call

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

twice but afte I commented the second one out, the failure jumps to the next call:

out\com\android\server\PowerManagerService$BrightnessState.smali[406,4] mismatched input 'invoke-static' expecting set null

Do you know whats the failure?

Setting the

.method private native nativeStartSurfaceFlingerAnimation(I)V

to

.method public native nativeStartSurfaceFlingerAnimation(I)V

changed nothing!

If I comment out the call to the nativeStartSurfaceFlingerAnimation like this:

.line 2679
.restart local v3 #turningOff:Z
:cond_38

[COLOR="Blue"]iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/4 v3, 0x11 # CRT-On and CRT-Off[/COLOR]
[COLOR="Red"]#[/COLOR][COLOR="Blue"]invoke-direct {v4, v3}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)[/COLOR]

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

#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightness:Lcom/android/server/PowerManagerService$BrightnessState;
invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$6000(Lcom/android/server/PowerManagerService;)Lcom/android/server/PowerManagerService$BrightnessState;

move-result-object v4

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

I get this failure, maybe there is a problem with the type of v3?

out\com\android\server\PowerManagerService$BrightnessState.smali[403,4] 17 cannot fit into a nibble

Where 17 is the 0x11 which we want to set for animations!?
[Galaxy S II Themes and Apps] sphinx02:
So I found some mistakes:

Here the V was missing that was the reason for the first error:

iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/4 v3, 0x11 # CRT-On and CRT-Off
invoke-direct {v4, v3}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)[COLOR="Red"]V[/COLOR]

after correct it, still the failure with the 17 to big for a nibble was present, so I looked up and thought about only the crt-off effect should be 0x01 and I changed the code to this:

iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/4 v3, [COLOR="Red"]0x01 [/COLOR]# Only CRT-off !?!?
#const/4 v3, 0x11 # CRT-On and CRT-Off
invoke-direct {v4, v3}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V

so I was able to recompile everything, but modified services.jar on the phone, there still was no crt-off..

Than I thought about calling a function in the other file has to be managed a little bit different like other functions are called. I added following to the PowerManagerService.smali

.method static synthetic access$9000(Lcom/android/server/PowerManagerService;I)V
.registers 2
.parameter "x0"
.parameter "x1"

.prologue
.line 110
invoke-direct {p0, p1}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V

return-void
.end method

And called the nativeStartSurfaceFlingerAnimation(i)V like this:

iget-object v4, p0, Lcom/android/server/PowerManagerService$BrightnessState;->this$0:Lcom/android/server/PowerManagerService;
const/4 v3, 0x01
#const/4 v3, 0x11 # CRT-On and CRT-Off
[COLOR="Red"]#[/COLOR]invoke-direct {v4, v3}, Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)V

#calls: Lcom/android/server/PowerManagerService;->nativeStartSurfaceFlingerAnimation(I)
[COLOR="Blue"]invoke-static {v4, v3}, Lcom/android/server/PowerManagerService;->access$9000(Lcom/android/server/PowerManagerService;I)V[/COLOR]

I still was able to compile the file and it still is running without errors on the phone but there is still no crt-off effect :(

In LogCat I havent found anything what can help.. Do you know what else I can do? What do I have to search for in LogCat? Or is the 0x01 for CRT-off effect only not correct? Perhaps you can give me some advice again!
[Galaxy S II Themes and Apps] xXCorleoneXx:
works all great,

thank for this awesome crt. :)
[Galaxy S II Themes and Apps] Tungstwenty:
Sorry, my mistake about both the missing V (wrong copy&paste) and the const thing.

It should have been this instead:

const[COLOR="Red"]/16[/COLOR] v3, 0x11 # Both OFF and ON

With this both cases will be tested, to see whether the native library is working.

There's an additional thing that I'd like to point out so you check it: a little above that code you should have

.line 2665
.local v3, turningOff:Z
:goto_10
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

[COLOR="red"] if-nez v4, :cond_18[/COLOR]

if-nez v3, :cond_38

.line 2666
:cond_18
...

You need to comment out the line in red, in case you've not altered mAnimateScreenLights to false (if it's true, which is default, it never does CRT)

One other thing you can do to make sure it's going through there is place a logcat message:

const-string v?, "Place X"
invoke-static {v?, v?}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I

Place one of these right after :goto_10, using v4 in all 3 occurrences, and another one right after :cond_38, also with v4 (and perhaps "Place Y").

That way you can then validate whether your changed code is actually being called.
[Galaxy S II Themes and Apps] sphinx02:
Thanks bro, thats it! With the change to

const/16 v3, 0x11

and with my way of calling over the static method, it works!

But I think with the same problems than on the s2: Sometimes it flickers after the CRT-Off effect! And the CRT-On effect is never shown..

Here I made a Video of it (password: xda) but sorry for the bad quality, but you can see on the third try it flickers and this is happening randomly..

http://www.vidup.de/v/OGcZz/

Do you see a possibility to fix this again in the .so lib file? Or can you just tell me how this is done?

Are you agree, that I open a new development thread in the s3-forums, to present our work?

BTW: I have not commented out "if-nez v4, :cond_18" and tried it with the stock framework-res.apk and it still works.. Dont no weather it is not dependet from the config_screenLigthAnim parameter on the s3!?
[Galaxy S II Themes and Apps] sphinx02:
Release in s3 forums.

So Tungstwenty and rovo89, I made a new thread in the s3 forums, all credits goes to you, as without you I could never make these changes! Thank you very much!

I hope we can continiue our development discussion in the new thread:

[DEV][HOW-TO] Enable CRT-off on S3 Stock ROMs

It would be very very nice if you can help again, doing something against flickers after the effect and perhaps enabling the crt-on also!

Thank you, thank you, thank you!!!
[Galaxy S II Themes and Apps] Tungstwenty:
Glad it worked.

So, you're pretty much on the same situation S2 owners were after the effect was activated on the java side.

As for the fixes in the native code of the S3 library, I replied in the new thread but essentially what I'm saying is that it's pretty hard already to do this using your own device; doing it without having an S3 to test it on is one order of magnitude harder ...

Perhaps some an attempt could be made time later, but right now too busy to dig into that (at least from my side).
[Galaxy S II Themes and Apps] sphinx02:
Ok, I understand that it is difficult and that you dont have too much time to spend on it but it would be very nice if you can have a look to the new thread and answer my questions in a short way from time to time! Only if you have the time to, I dont want to stress you!
[Galaxy S II Themes and Apps] The Undertakerr:
Heyy Tungstwenty,

On the S3 part of this forum, Mr Sphinx(From the post above this one), managed to get the CRT On working, without the need to use the Xposed framework; by making changes to services.jar. This I would like also. Maybe a chance you would be willing to look into 4.0.3LPG services.jar, so we can have this Ctr On also?

Or what changes need to be made in services.jar to accomplish this?

Attached the LPG services.jar: https://dl.dropbox.com/u/25779832/SGS2/ALLES ICS/services.jar

Thanks in advance...
[Galaxy S II Themes and Apps] Mirko ddd:
hahaha bas, you are the man :D
[Galaxy S II Themes and Apps] The Undertakerr:
Lollzz, yes my man, that would be very nice to have!

Maybe you want to give it a try?

Look here for the changes that need to be made to get it to work on S3 services.jar: http://xdaforums.com/showthread.php?t=1725361

It involves changes to com/android/server/PowerManagerService.smali and com/android/server/PowerManagerService$BrightnessState.smali

I've tried a couple of combinations, but not much joy: No Boot:silly:

I saw it on my girls S3; looks really nice, and no need for external apps like exposed tweakbox and framework... I'm a bit yealous.. Why she can have it on her S3 and we not on our S2? :cyclops:
[Galaxy S II Themes and Apps] Tungstwenty:
Check my signature - I don't need a link to the jar, do I? ;)

The patch is really easy and I'm more than happy to tell you guys the small change that is needed.

But I do refrain myself from editing apks or framework jars when Xposed is available. I don't want anyone to depend on me for XWLPI, J, K, XXLQ5, etc. etc. This is one of the big reasons Xposed is so great both for developers and for end-users.

I'm busy enough investigating new stuff, to have enough energy to do the same patch over and over again on pretty much similar files, but which still need to be changed to match each ROM. I hope you understand :)

That being said, the changes are really easy. Anyone can do it as long as they've used apktool / baksmali before. And if they didn't, it's also very easy to start and it will be useful in similar situations.

Did any of you ever used the patched dialers to have the noise cancellation button, no increased volume, etc? I was always bothered by the fact that it was a "lost apk" that noone really knew from which version did it originate. Here it's the same, only since it's a framework file it's not an option not to have a matching version.

- Start off by decompiling the services.jar/odex code.

- Go to com/android/server

- Edit the "PowerManagerService$BrightnessState.smali" file

- Towards the end of the run() method, you should find an invocation to jumpToTargetLocked:

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

(note that in other builds, it might be another register instead of v4)

- A bit above that, there is a test against the number 4:

const/4 v8, 0x4

if-ne v7, v8, :cond_54

This is to see whether the reason for turning the screen off is the proximity sensor, in which case there's no animation.

- Follow that "cond_54" label and see the code that's a bit below that.

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

invoke-static {v4}, Lcom/android/server/PowerManagerService;->access$2200(Lcom/android/server/PowerManagerService;)I
:try_end_59
.catchall {:try_start_54 .. :try_end_59} :catchall_51

move-result v4

goto :goto_44

This is fetching the "animation flags" from the PowerManagerService and placing it in v4.

What you need to do, is after that "move-result v4" and before jumping back to _44, add the instruction "const/16 v4, 0x11". That means CRT-On and CRT-Off both active and it will trigger the effect.

That's it; for a hard-coded, always active On+Off effect, you only need to add that single instruction.

Finally, compile the apk with the updated code and if that's the case, odex it back on the device.

BTW, if you want to "cheat" and look at java code instead of smali, here's the aosp code, which is pretty much what you're seeing when decompiling (Samsung doesn't appear to have changed this part)
[Galaxy S II Themes and Apps] The Undertakerr:
Thank you so much, Tungstwenty!!

It's working!! Thank you very very much for that great explanation!!

With your permission I'll put the LPG services.jar with CRT On here in your thread?

I'm sure many people like it!

Thanks again, very happy with this!!

Thanks again!
[Galaxy S II Themes and Apps] Tungstwenty:
Sure, no problem. I'll update the OP with a link to your post.

As long as I don't have to maintain the patches :p
[Galaxy S II Themes and Apps] The Undertakerr:
Ok, thanks to Tungstwenty, now we can also have the CTR ON effect, without the use of exposed framework and tweakbox.

Flash this zip, and you will both have Ctr ON and Ctr OFF.

This zip also contains Tungstwenty's libsurfaceflinger.so, for both perfect Ctr On and Off.

Flash this zip only on DE-ODEXED Samsung firmware 4.0.3LPG! (It contains LPG services.jar)

https://dl.dropbox.com/u/25779832/SGS2/ALLES ICS/LPG Ctr ON-OFF.zip

So this zip has everything you need for both the effects! (No longer the need to config_animateScreenLights from true to false in framework-res.apk)

All credits go to Tungstwenty, and please do not ask him for other firmware versions of this mod like he requested...
[Galaxy S II Themes and Apps] Tungstwenty:
You mean 4.0.3, XWLPG, right?

Maybe an assert in the beginning of the update script would be better...

While you're at it, why not do an additional change and not require framework-res.apk to be patched? :)

Look at aosp line 2219.

In the same method that you changed:

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

[COLOR="Red"] if-nez v6, :cond_19
[/COLOR]
if-nez v3, :cond_39

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

The line in red jumps if mAnimateScreenLights is true, doing the "if" part of the condition. The next "if" is the "!turningOff".

Just remove the red line and if it's not turning off, it will do this part. But if it's turning off, regardless of mAnimateScreenLights, it will go to the part with CRT ;)
[Galaxy S II Themes and Apps] The Undertakerr:
Done&Tested!! Thanks again for this very usefull information!

Will edit my post above, with new zip. The change to framework-res are now not necessary anymore!:silly:
[Galaxy S II Themes and Apps] iTK:
thank you Tungstwenty & rovo89

since the link "The Undertakerr" posted is down i made my own following your instructions

its not a flashable zip, just the modified files needed for this marble to work, use adb to push them onto your device

thanks again

View attachment xwlpg403.zip
[Galaxy S II Themes and Apps] darth_mickrig:
Can you make a version for 4.0.4 stock ROMs, as they are effected by the flinger bug again.

Big thanks in advance!!!
[Galaxy S II Themes and Apps] Tungstwenty:
Sorry, I currently don't have the time to do it.

I'll probably get back to this once we get our JB versions. 4.0.4 looks like a very temporary situation as there hasn't been any major rollout. Personally, I'm still on XWLPG.
[Galaxy S II Themes and Apps] arvin2212:
-Removed-
[Galaxy S II Themes and Apps] rovo89:
Oh no, I directed you to the wrong thread. I just looked for the one with "stock" in its name. Very sorry for that. And glad you posted in the correct thread as well, I'll have a look at it there.

As for the original topic of the thread: In 4.2, the CRT effect has finally been moved to Java code. This means that modifying it is much easier, especially if you are compiling your own ROM. It might also become the target of an Xposed module again, although it has a low priority for me (CRT off is working fine by default). Which doesn't mean that nobody else could take care of it. ;)
[Galaxy Note GT-N7000 Q&A, Help & Troubleshooting] Gaurav99:
if any one have N7000DDLP8 inu resumable link plz give me no torrent plz i hv slow net ....
[Galaxy Note GT-N7000 Q&A, Help & Troubleshooting] Gaurav99:
Found it....if any one want here it is and i don't know i can post website address here or not.....but finally i got ics

http://narod.ru/disk/50257132001.cbb0f010e904fb72db3c831268ab9391/N7000DDLP8_N7000ODDLP5_INU.zip
[HTC Rezound] jmichaels1982:
So we all know that font changers wont work in ics .

after LOTS of digging i found these two pages and they work ok.

http://xdaforums.com/showthread.php?t=1630784

then read

http://rootzwiki.com/topic/15077-how-to-make-font-packs-that-work-with-ics-including-bold-and-bold-italic-variants/

except its pain in the ass and sometimes i cant get my own font to work correctly from scratch

and here is a list of all the fonts

http://www.dafont.com/

My dilemma is

1- man its a painful procedure just to preview how they will look on my phone

2-i cant seem to build my own font in italic and bold correctly, i built morpheus which worked on inef deus 1.0 but no bold or italics

can any one guide me and show me where i can make this easier on ics

Update 1: Ok so i think i figured out how to just changed the regular font using any font from font installer aside from changing it completely successfully form the second forum link posted above. The bold and the italic and bold-italic is still the problem

here are my steps :

1- go to font installer

2-in preferences choose the select font option and choose ONLY roboto regular

3-install the font of your liking but DO NOT reboot phone yet

4-go to es explorer and make sure you have root enabled and go to system/fonts

5-choose all the roboto fonts and enable all permission

6-if you have go launcher like me go to preferences and select the regular roboto form system fonts

7-reboot

all the bold , italics will be the system font, every thing else will be your new font.
[HTC Rezound] hardfallen87:
i used font installer from the market and it worked for me, although certain fonts will cause your phone to bootloop, alot of them do work.
[HTC Rezound] jmichaels1982:
utter failure

Yep font installer = boot loop and nandroid .

I even tried doing the roboto trick from the program its self then went to es explorer and changed permission to full which is essentially what i do manually if i get the font pack my self . still causes the system to hang and battery pull and hboot recovery is warranted.

on this forum someone mentioned only change roboto but ur fonts wont change. Do people no care that font can not be changed in ics ?