nikp123 / scrcpy-desktop

Run an Android desktop environment off of a device using ONLY scrcpy
GNU General Public License v2.0
214 stars 15 forks source link

Improvements to powershell scripts #12

Closed Pawloland closed 2 years ago

Pawloland commented 2 years ago

Hi, I added some improvements to windows scripts. I added connectionKeeper.ps1 script. It was necessary because adb changes weren't always reverted when I was using scrcpy via Wi-Fi. Now whenever a file the script now creates on device isn't changed it is taken as connection loss and stage2 cleanup is started. I also added option to automatically enable and disable nullkeyboard, so the script no longer errors out when nullkeyboard is installed but disabled as IME. You can see some other minor stuff in commit history. Cheers

nikp123 commented 2 years ago

also if you happen to know a way to fetch the resolution properly, that'd be a nice addition (at least one that isn't specifically made for Windows Enterprise edition)

nikp123 commented 2 years ago

image also this is SUPER annoying

nikp123 commented 2 years ago

we should rid of connection keeper as it's super buggy, or at least provide a solution that is less prone to breakages

Pawloland commented 2 years ago

image also this is SUPER annoying

Sorry. I have never seen this prompt when testing. I guess it's because some time ago I disabled those things globally, because they annoyed me also. More on this can be found here.

nikp123 commented 2 years ago

also i think i may have found out why connectionkeeper is not working out for me

nikp123 commented 2 years ago

because my VM is super slow (i mean really slow for an average WIndows PC), it cannot load the script in time and the stage 2 payload kills itself because the computer hasnt responded in time, which is hilarious

nikp123 commented 2 years ago

adding a 10 or so second delay before the 3 connection checks solves the issue though

nikp123 commented 2 years ago

nope, the thing still somehow manages to kill itself

nikp123 commented 2 years ago

managed to finally fix dumb powershell issues

nikp123 commented 2 years ago

what you've committed is a bit setup-specific, i should've tested before merging.. but anyway the issues boils down into a few parts:

  1. server dies really quickly because the interval is too short
  2. background job should be A JOB, not an entire script
  3. file paths are all messed up when running external jobs; the file path of adb is inaccessible from connectionKeeper.ps1 causing issue 1 (for the most part) and killing the server EVERY TIME
nikp123 commented 2 years ago

well most of these are fixed, just to backport to bash