yashsingh1/xdaforums huggingface dataset:
[Galaxy S III Android Development] sphinx02:
Ok I managed to get the right code with the assembler with this snippet:

.data

.text

.thumb
.globl _start
_start:

/* syscall exit(int status) */
mov %r0, $0 /* status -> 0 */
mov %r7, $1 /* exit is syscall #1 */
swi $0 /* invoke syscall */

[COLOR="Red"].org 0x1a390
tobecalled:
mov %r0, #0

.org 0x1e706
callit:
bl 0x1a390[/COLOR]

So it gives me the correct bytes.. But sometimes I dont know how to find where I have to make the bl / blx or b.w.. For example:

b.w	1c518 <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE+0x28>

There you go into the

<_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE>:

But this function looks very different in the new BLFB lib when you add the 0x28 to the beginnig of the function:

Old one:

0001c4f0 <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE>:
1c4f0:	b5f7	push	{r0, r1, r2, r4, r5, r6, r7, lr}
1c4f2:	ad02	add	r5, sp, #8
1c4f4:	2400	movs	r4, #0
1c4f6:	f805 4d01	strb.w	r4, [r5, #-1]!
1c4fa:	688f	ldr	r7, [r1, #8]
1c4fc:	684e	ldr	r6, [r1, #4]
1c4fe:	e006	b.n	1c50e <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE+0x1e>
1c500:	f856 0024	ldr.w	r0, [r6, r4, lsl #2]
1c504:	3401	adds	r4, #1
1c506:	6801	ldr	r1, [r0, #0]
1c508:	6d0b	ldr	r3, [r1, #80]
1c50a:	4629	mov	r1, r5
1c50c:	4798	blx	r3
1c50e:	42bc	cmp	r4, r7
1c510:	d1f6	bne.n	1c500 <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE+0x10>
1c512:	f89d 0007	ldrb.w	r0, [sp, #7]
1c516:	bdfe	pop	{r1, r2, r3, r4, r5, r6, r7, pc}
1c518:	edd0 1a00	flds	s3, [r0]

New one:

0001f8a8 <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE>:
1f8a8:	e92d 4ff7	stmdb	sp!, {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
1f8ac:	f10d 0908	add.w	r9, sp, #8	; 0x8
1f8b0:	2600	movs	r6, #0
1f8b2:	f809 6d01	strb.w	r6, [r9, #-1]!
1f8b6:	4634	mov	r4, r6
1f8b8:	f8d1 b008	ldr.w	fp, [r1, #8]
1f8bc:	4637	mov	r7, r6
1f8be:	f8d1 8004	ldr.w	r8, [r1, #4]
1f8c2:	4631	mov	r1, r6
1f8c4:	f7fd f914	bl	1caf0 <_ZN7android14SurfaceFlinger12graphicPlaneEi>
1f8c8:	f7fc fa98	bl	1bdfc <_ZN7android12GraphicPlane19editDisplayHardwareEv>
1f8cc:	f7fa fcdc	bl	1a288 <_ZNK7android15DisplayHardware13getHwComposerEv>
1f8d0:	4605	mov	r5, r0
1f8d2:	e016	b.n	1f902 <_ZN7android14SurfaceFlinger12lockPageFlipERKNS0_11LayerVectorE+0x5a>
1f8d4:	f858 0026	ldr.w	r0, [r8, r6, lsl #2]
1f8d8:	4649	mov	r1, r9
1f8da:	ea4f 0a86	mov.w	sl, r6, lsl #2

How do I know where to go if these function differs? Really hard stuff...
[Galaxy S III Android Development] sphinx02:
Patched lib-file for XXBLFB

Hey Tungstwenty,

after hours on the lib-file I finally got one working! It was really hard work and without your help it wouldnt have been possible for me to do it.

Thank you man!

See my MODDING thread for the patched lib-file!

regards..
[Galaxy S III Android Development] failax:
Great news!

It's usable also on BLG1?
[Galaxy S III Android Development] beaver2233:
Yes, tested and confirmed (on omega 9)
[Galaxy S III Android Development] Tungstwenty:
Great going, congrats!!!

It's good you no longer depend on me to keep up with occasional changes in the base libs :)
[Galaxy S III Android Development] sphinx02:
I hope you are right, but I dont really understand all of the commands I have edited and so I dont know if I will fail when the lib changes too much in future..

But thank you for your very good support!
[Galaxy S III Android Development] jugih:
omg! Thank you both so much!
[Galaxy S III Android Development] comnam90:
You should try writing up a quick guide :D
[Galaxy S III Android Development] starbucks2010:
Great job guys. Many happy people.

Best regards.
[Galaxy S III Android Development] aquariex24:
Man I am very tempted to try the new files on my US Galaxy S3 for Sprint but I'm guessing that wouldn't be a very good idea. Is there any way I can backup the files in which this mod affects and then restore them in case something goes wrong? I assume the backup .zip you currently have wouldn't restore the same files I currently have...

Edit: By the way, last week when I rooted a phone for the first time I was unaware that applying this mod could have a negative effect on my US variant so I installed the original CRT-Off/On mod using the Tweakbox method and when I did that only the CRT-Off effect worked (with a rare flicker) so maybe that is a sign that since the original CRT-Off effect worked with my device then it could also be compatible with this latest one and possible fix the issues?
[Galaxy S III Android Development] Tungstwenty:
If you don't have any other mod installed, the fact that you're getting CRT-Off in the first place is a sign that it's working in triggering the effects.

Now, if it only shows Off and with the flicker, it means it's not dynamically replacing the lib. rovo89 was pinpointing this in order to make it work, you could post you issue in the Tweakbox thread to see if it's the same.
[Galaxy S III Android Development] aquariex24:
Thank you for the quick reply. I know some other people in this thread also had the same issue regarding CRT-Off being the only effect that worked but since the latest update by sphinx it is working for them. I have the US variant so wanted to see if there was a way to backup the files which are being effected. I guess I would have to do a nandroid backup to be safe. Can you tell me if Tweakbox automatically backs up these files so when you turn off the effects it goes back to the original? And will Tweakbox be updated with the latest lib files from sphinx?
[Galaxy S III Android Development] Tungstwenty:
Tweakbox doesn't backup the files, because it doesn't replace them. Instead, it places the patched files in an alternate directory and makes sure the other processes load required libs preferably from that path. If Xposed is uninstalled or disabled everything is back to normal.

I was planning on updating the new S3 lib to include it in Tweakbox but I'm glad sphinx beat be to it :)

If he's ok with it, I'd include his file instead if doing the patch from scratch. From the reports, it's working fine.

BTW, are you guys using the landscape effect as well?
[Galaxy S III Android Development] sphinx02:
Of course he is ;)
[Galaxy S III Android Development] Tungstwenty:
Thanks!

Can you let me know which ROM build does it work on? I know the previous file worked on a certain one (don't know which) and IIRC there were 2 later builds where it didn't work. Can you let me know which ROMs do the 2 patched libs cover in total?

Also, can you confirm whether the landscape CRT effects are also working properly - both in the previous one and also in the one you patched?
[Galaxy S III Android Development] sphinx02:
The previous one, you patched is working on all XXAL ROMS like XXALE8, XXALF2, XXALF6 others I havent tested but I think its working on the others, too..

New one I patched, is working on all XXBL ROMS like XXBLFB and XXBLG1..

I updated the first post, due to this different lib files!

And with the landscape mode: as I never used your Tweakbox-Variant of triggering the CRT-OFF effect I never tested the landscape-version.. How is it triggered? I can test it if I know that...
[Galaxy S III Android Development] Tungstwenty:
You need to check the code at method "onProposedRotationChanged" of class com.android.internal.policy.impl.PhoneWindowManager$MyOrientationListener. If it's invoked with a value >= 0, use that value to call

android.os.SystemProperties.set("runtime.xposed.orientation", value as a String);

Whenever doing animations, the lib will inspect the current value of that variable and use a portrait or landscape effect.

In I9100, the latest XWLPM (which is 4.0.4) no longer works properly because that "onProposedRotationChanged" isn't called in every situation, I didn't yet understand why.
[Galaxy S III Android Development] aquariex24:
Ah OK. So Tweakbox seems like the safer way to go rather than flashing, especially if I have a different variant than the one the flash files are intended for. Will you let us know on here once it's updated or should I keep my eye on the "Xposed" thread?

And one last question if you don't mind. Earlier after I asked a question, you said "If you don't have any other mod installed, the fact that you're getting CRT-Off in the first place is a sign that it's working in triggering the effects." Does this include ANY mod or just ones intended for that specific effect? Or would other mods that have nothing to do with CRT-off still mess things up? At first I thought I could install a CRT-Off mod, a camera mod, battery mod, etc. all while keeping the stock ROM. Like upgrading car parts instead of getting an entire different car/ROM. Maybe I can't really do it like that and would need to find a non-stock ROM that includes CRT-off, a camera mod, etc.? Thanks for your patience with a noob like me!
[Galaxy S III Android Development] failax:
I don't like landscape mode, I disabled it in tweakbox.
[Galaxy S III Android Development] Tungstwenty:
If you want to use it, you should definitely follow that thread to check for updates.

About the mods - for this to work you need to have a mod installed, such as sphynx's one that is mentioned in the OP. Or, any other mod that includes the same java patches. Without that change, the effect that is present even in the original lib (despite the flickers) won't be triggered. If you use one of the patched libs, the flicker is gone and you also get the CRT-On effect which wasn't present in the original lib.

So, I meant ANY mod but that specifically provides this. Again, sphynx's mod is an example of those. Tweakbox is another, although it works in a different way. If you also install a mod for camera, battery, etc. they shouldn't interfere with this. But the problem starts when you use mods for different changes that happen to need changing the same files. Typically those will not coexist and only one of them will actually be active because it replaced the file from the other installation. When combining mods, you'll need to understand whether this will happen (which might consist of doing a backup and testing it out, or asking in the appropriate threads).

Solving this issue is precisely one of the goals of Xposed / Tweakbox, which is not to patch files on disk, but rather just intercept individual method calls and manipulate the values. It's therefore much more likely that it won't collide with other mods, even if the same apps / packages are targeted by each mod.

Ultimately you'll still need to identify all the mods available that give you things you want and combine them, so good luck :)

---------- Post added at 09:54 PM ---------- Previous post was at 09:54 PM ----------

Yup, the button is there precisely because it's a matter of taste :)
[Galaxy S III Android Development] sphinx02:
Ok, this method looks like this:

# virtual methods
.method public onProposedRotationChanged(I)V
.registers 4
.parameter "rotation"

.prologue
.line 754
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$MyOrientationListener;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

const/4 v1, 0x0

invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateRotation(Z)V

.line 755
return-void
.end method

What do I have to edit? I have to convert parameter "rotation" to string and send it to android.os.SystemProperties.set?

Can you help me with the Java-Assembler :D? Or perhaps its easier to test it via Tweakbox, I dont know..
[Galaxy S III Android Development] Tungstwenty:
If you don't yet feel comfortable directly editing smali :) the best way is for sure to create some java code, compile it, and then have a look at the generated smali.

For this particular part, you can find the Tweakbox code here.
[Galaxy S III Android Development] sphinx02:
Ok, I got it working and the landscape mode works good!

I replaced onProposedRotationChanged(I)V in PhoneWindowManager$MyOrientationListener.smali (android.policy.odex) with the following code:

.method public onProposedRotationChanged(I)V
.registers 4
.parameter "rotation"

.prologue
.line 754
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$MyOrientationListener;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;

const/4 v1, 0x0

invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateRotation(Z)V

.line 755

if-ltz p1, :cond_0

const-string v0, "runtime.xposed.orientation"

invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

move-result-object v1

invoke-static {v0, v1}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V

:cond_0
return-void
.end method

And now if you go for example in gallery to landscape mode, the crt is also in landscape mode! What exactly was the problem with this on the s2?

EDIT: Ok I see a problem. If you go for example to gallery and turn phone to landscape and then turn off screen, the crt is in landscape. But if you turn the phone to portrait while screen is off, this is not recognized and the crt is still in landscape! That means you first have to go back to the gallery and make a switch from landscape to portrait to go back to normal crt animation (also in case you start a portrait-only-app from lockscreen directly like phone-app you have to do the switch from landscape to portrait manually)..
[Galaxy S III Android Development] Tungstwenty:
Yes, that's the issue. On the S2 it worked perfectly until the 4.0.4 builds came out.

The behavior was that provided that "auto-rotation" was set, the orientation would be updated independently of whatever is on the screen. You could have TWLauncher, tilt it to landscape (TW stays the same) and turning off would make the landscape effect. Then, even if you rotated it to portrait during sleep, when waking up it would update the variable and do a portrait CRT-On.

On the 4.0.4 ROMs this method is called less often and so the updates don't always work. I didn't yet manage to find a way to make it work as before.
[Galaxy S III Android Development] aquariex24:
Any idea when Tweakbox will included the updated files? I've been keeping an eye on this thread and the other but guessing you're kinda busy or put it off to the side for now?
[Galaxy S III Android Development] RaymondPJR:
I'm wondering the same thing. Only crt off works on the stock rooted T-Mobile rom and it flickers.
[Galaxy S III Android Development] Препод:
Hello! Address the issue of CRT-On and CRT-Off at LIB by JB. It works, but CRT works three times. I need to correct libsurfaceflinger.so. Who will help with the lib?

Used Google translator
[Galaxy S III Android Development] Tungstwenty:
Can anyone try using this lib to see if it works? I don't have an S3 to test it.

Use ADB in recovery mode and manually replace the lib with the libsurfaceflinger-XXDLIB-CRT_TT.so one (change the name and adjust the owner and permissions).
[Galaxy S III Android Development] Препод:
Unfortunately it is not working. Black screen.: Плачу:

Used Google translator
[Galaxy S III Android Development] failax:
How can i set permissions with only mobile device?What program can I use?
[Galaxy S III Android Development] blu3angel:
Use root explorer or es explorer. U can set permissions using this explorers...
[Galaxy S III Android Development] failax:
Have you set permissions?
[Galaxy S III Android Development] wiecho65:
its working?? Anybody try??

Tungstwenty thanks for try,i hope its work.
[Galaxy S III Android Development] Препод:
I used the Root Explorer. Permissions rw-r--r--
[Galaxy S III Android Development] blu3angel:
How about the owner? Have you try changing it to Owner 0 - root and Group 0 - root? It was mentioned by Tungstwenty to adjust the owner too...
[Galaxy S III Android Development] Препод:
Used different methods. (CWM, Manual)
[Galaxy S III Android Development] wiecho65:
Hello mates. Still any progress??? Tungstwenty can you help Us with this??

Wysłane z mojego GT-I9300 za pomocą Tapatalk 2
[Galaxy S III Android Development] dlads:
Has anyone got this working on JB rom's yet?
[Galaxy S III Android Development] Препод:
CRT-OFF

CRT-OFF for JB LIB! HEREThe guy is worried that I shared his work. Put him "like". All the credit to him. I have never taken his work. Just shared with you.

Google Translate
[Galaxy S III Android Development] DSA:
Nice one dude, will give feedback later
[Galaxy S III Android Development] blu3angel:
Nice job man!! Its working perfectly with my wanam 3.7 rom... Awesome!! :thumbup:

Sent from my GT-I9300 Pebbleblue 32gb
[Galaxy S III Android Development] Dark One:
Just flashed it and all is well. Nice one. :)
[Galaxy S III Android Development] failax:
It is possible also CRT-ON?
[Galaxy S III Android Development] Kingken:
crt on working on viking...thank a lot!!
[Galaxy S III Android Development] failax:
On or OFF?
[Galaxy S III Android Development] darwinwin:
not working on stock jb , could anyone provide the odex version?
[Galaxy S III Android Development] Kingken:
OFF..........
[Galaxy S III Android Development] vesspa:
Working on insertcoin 1.4.1
[Galaxy S III Android Development] jenicekk:
+1 please
[Galaxy S III Android Development] Препод:
I have no files for Odex.

Google translator
[Galaxy S III Android Development] leamoor:
Do you mind share how to modify this on 4.1.1,i went to modify this for i9305

l guess they are completely

thanks:p
[Galaxy S III Android Development] wanam:
Well done Препод :good:.

I didn't test it yet, the modification was made on "servicesjar\com\android\server\PowerManagerService$ScreenBrightnessAnimator.smali" :

.line 2906
.end local v0 #delta:I
:cond_60
:goto_60
iget-object v7, p0, Lcom/android/server/PowerManagerService$ScreenBrightnessAnimator;->this$0:Lcom/android/server/PowerManagerService;

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

move-result-object v7

++if-eqz p2, :cond_75

++const/16 v9, 0xb

++const/4 v10, 0x0

++const v2, 0x10

++invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;

++move-result-object v9

++invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V

++:cond_75
const/16 v9, 0xa

invoke-virtual {v7, v9}, Landroid/os/Handler;->removeMessages(I)V
[Galaxy S III Android Development] Препод:
It is so!
[Galaxy S III Android Development] czar22:
thx!!! good job

but after 2/3 lock's the the screen isn't responding ...and has a lag ..

hope to fix it

InsertCoin-ROM
[Galaxy S III Android Development] wanam:
No issues here!
[Galaxy S III Android Development] 89dogg:
testet now with omega and there are after some tries again flickers like in ICS at beginning.

i think libsurfacelinger.so has to be modded too. like in ICS.

anyway, great work, but without flickers it would be a lot better :)
[Galaxy S III Android Development] failax:
Everything is perfect also on CriskeloRom.

I thought libsurfacefinger.so must be changed.

I hope CRT-On will be available soon too.
[Galaxy S III Android Development] kenzolo:
Omega 27.2

When in home screen it closes ok.

But when in lock screen it will not close at all. It comes back with some strange glitch
[Galaxy S III Android Development] wanam:
I confirm this issue on lockscreen.
[Galaxy S III Android Development] semantsen:
working well..

Working well here both on Home and lock screen,:) even auto locks with it.

Thanks
[Galaxy S III Android Development] wiecho65:
I also confirm issue. Turkbeyrom v14.

Wysłane z mojego GT-I9300 za pomocą Tapatalk 2
[Galaxy S III Android Development] 89dogg:
to resolve this issue the libsurfacelinger has to be fixed. this was in ics like this way and it's the same in jb.

but otherwise i've to say geat to see movement in crt. i was missing it on jb :)
[Galaxy S III Android Development] dlads:
Legend.
[Galaxy S III Android Development] MasterThiefGarrett:
Exactly, same here (on VikingROM)

PS dalvik cache wipe and cache partition wipe does nothing to help :(
[Galaxy S III Android Development] w1nter456:
How you do that?
[Galaxy S III Android Development] jeanhaker:
Working well here both on Home and lock screen,:good: no errors everything right, excuse my English
[Galaxy S III Android Development] starbucks2010:
working fine in Foxhound v.0.8. no glitches at all.

waiting for crt-on.

thank you for your work.
[Galaxy S III Android Development] fl4m3y:
Is there any way to get the CRT OFF to the latest ICS (LH1) firmware?

For BLG8 there is a mod but I can't find a new one... Help is welcome :o
[Galaxy S III Android Development] Dark One:
Make a nandroid and try the BLG8 version, there's a good chance it's the same file for both. ;)
[Galaxy S III Android Development] fl4m3y:
Thanks for the info! I've tried the CRT OFF but doesn't boot up... It stucks at the samsung logo :(

Gesendet von meinem GT-I9300 mit Tapatalk 2
[Galaxy S III Android Development] :
anyone test it on any rom with JKay alpha7 and JB domination theme 1.3.5 ?!

for me i stuck at boot loop

any idea plzzzz ?!
[Galaxy S III Android Development] jenicekk:
version for odex LIH please
[Galaxy S III Android Development] S_Dot:
Version for Check Rom?
[Galaxy S III Android Development] jeanhaker:
crt on anything even in jb? :confused:
[Galaxy S III Android Development] herlly:
any idea how to make enable for ELKC based ROM ?
[Galaxy S III Android Development] The Broken:
Working on 4.1.2?
[Galaxy S III Android Development] andybones:
Can anyone please help me get this working on Verizon 1535.10

4.1.1

I don't have the PowerManagerService$BrightnessState.smali ....
[Galaxy S III Android Development] freddy1991:
I wonder why this thread is inactive. .....

Sent from my GT-I9300
[Galaxy S III Android Development] ManDone.vRs:
I have XXEMC3 4.1.2 JB , it is working ??
[Galaxy S III Android Development] Sumanta123:
Is this working on galaxy grand?
[Galaxy S III Android Development] NicoCaldo:
I did not include the effect well as CRT OFF

I have already familiar with using Xposed Installer and Tweakbox.

I have to flash the file attacched via cwm and then select the library into by Xposed?
[Galaxy S III Accessories] dan079:
I have stop using cases for quite sometime. The main reason is that here in Cambodia it is so affordable and convenient to get gadget flim wrap.

In the past I only use either clear and frosted flims. I opt for colored flim for my SIII.

Here is how it look like.

Don't mind the crappy screen protector. Waiting for the ones from xtremeguard
[Galaxy S III Accessories] daisun:
That actually looks really good! Do you know of any reputable online retailer that does something similar?
[Galaxy S III Accessories] dan079:
Not really sure. I the films are not pre-cut. They do it the old fashion way whereby the stick and cut thereafter
[Galaxy S III Accessories] Baryyt:
Do you have a link of what film wrap to buy? Thanks
[Galaxy S III Accessories] dan079:
No I dont, what I can do is when I visit the shop the next time I will look for the film maker/ brand.
[Galaxy S III Accessories] Baryyt:
That would be great thanks :)
[Galaxy S III Accessories] psp888:
it's just a film, you'll still get a dented casing if you dropping it.
[Galaxy S III Accessories] 58285:
I'm pretty sure the SGS3 won't dent.
[Galaxy S III Accessories] Wond3r:
wow that looks great
[Galaxy S III Accessories] LowSky:
Just crack
[Galaxy S III Accessories] alfy!:
What's up with the scratches on your screen?
[Galaxy S III Accessories] ddurandSGS3:
"Don't mind the crappy screen protector. Waiting for the ones from xtremeguard"

from the original post.
[Galaxy S III Accessories] Xcor3:
the point of cases are to protect your phone.

if you want it to just look good, then i think your idea is great.

but when the phone drop face down then i dont think there would be any protection
[Galaxy S III Accessories] SlimJ87D:
I'm using an extreme guard right now. It kinda sucks.
[Galaxy S III Accessories] robbiekhan:
Is that a wrap on the side as well? if so then how it feel and does it look like it will peel easily? I could use one on my pebble blue phone where the bezel is purple!