nneonneo / iOS-SOCKS-Server

iOS HTTP/SOCKS proxy server for fake-tethering
275 stars 33 forks source link

Add pseudo-fullscreen mode for OLED displays #9

Open mihir-io opened 2 years ago

mihir-io commented 2 years ago

This PR addresses issue #8 and adds a popover pane that can essentially 'black out' the display, which for OLED-based iPhones means that the screen doesn't emit any light, and therefore saves battery life.

The way it works is to add a separate pane adjacent to the console window that has a single button to enable full-screen mode. Clicking that button will add a sub-view that opens the popover to black out the screen. By swiping down on the popover, you can close the popover and exit the pseudo-fullscreen mode while keeping the proxy server running. To enter full screen again, simply click the button from the side pane.

There are a couple caveats with this approach, that I'm planning to look into more for the future:

I think if I switched to the Scene library instead of the UI one, it might be possible to remove the battery charging icon in portrait mode. The home bar is probably there to stay outside of using guided access mode.

Photos:

The side pane with the "enter full screen" button, adjacent to the console photo_2021-12-26_13-17-50

The fullscreen view in portrait mode while charging photo_2021-12-26_13-18-02

Tested on iPhone 7 and 13 Pro.

regulad commented 2 months ago

I looked into playing a silent audio file for my use-case, but this seems a far more robust way to keep the app running. LGTM

regulad commented 2 months ago

I rebased these changes against the latest branch and added the landscape fix in my branch here: https://github.com/regulad/iOS-SOCKS-Server/tree/feature/fullscreen

I also applied Black since you had some single quoted strings.

regulad commented 2 months ago

Didn't want to clobber your PR or steal your thunder. Feel free force push your branch to mine!

mihir-io commented 2 months ago

@regulad I won't have access to my usual machine with Git for a few days. If you want to, feel free to go ahead and force push the branch -- I'm not worried about credit or anything. Otherwise I'll try to get to it sometime next week.

regulad commented 2 months ago

@regulad I won't have access to my usual machine with Git for a few days. If you want to, feel free to go ahead and force push the branch -- I'm not worried about credit or anything. Otherwise I'll try to get to it sometime next week.

I don't have write access. I'll just open a new PR.