It doesn't change resolution, only refresh rate. My device is rooted.
To be more precise: the phone gets to display 4k in some very few places. The only one I was able to see is the camera app viewfinder (only, not the UI), the wallpaper and Google Photos when playing videos (only, not the UI nor photos). Here are some examples. I tried to display this image, which is a test pattern I made, at 8k resolution (7680x7680). From bottom to top, it's 8k, 4k, 2k, 1k.
View attachment 8k_test_pattern.png
The reason I went 8k is because of chroma subsampling on my next example : video. Google Photos can't play yuv444p videos, so I had to use yuv420p, and that's why I went 8k so the 4k pattern won't be affected by the chroma subsampling.
View attachment 8k_test_pattern.mp4
Download the video (right-click, save link as) since it's so high definition lots of browsers won't play it.
Here are the results. From any app (I tried Google Photo and my gallery), it's rendered at 1096p because there are visible artifacts. But when viewing the
video from Google Photo's video viewer (only, my gallery app video player doesn't display 4k), the pattern is correct.
Screenshot from the Google Photo video player (which displays at 4k)

Screenshot of the previous screenshot from Google Photo (which displays at 1096p)

My previous comment is still relevant since, whether or not I set
service call SurfaceFlinger 1035 i32
to any of the numbers 0 to 3, the result is the same : 1096p everywhere except in Google Photo's video player. If you want to more drastic example, set
wm size
to a very small amount, and look at this... I set
wm size 274x640
(and the density accordingly at 105), everything on my phone is super lowres with very visible upscaling artifacts.... except the video, which is still at 4k!

So it's not even like in Android 11 where there was some apps that ran at 4k and others at 1096p, here, even within the same app, some content is at 4k and other at 1096p. So I guess it will be very hard to find a way to always output at 4k. Maybe we can use some hidden settings from Android 13? Android 13 allows to change the resolution of a device, but Sony didn't add this feature. Maybe there is still a way to activate it (via adb, root or something else).
I hope someone knowledgeable will be able to figure this out.