[General Topics] GalaxyA325G:
Wow. That's a lot to digest. You did great work!

Really great work!

Thanks for all that work on behalf of me and you and everyone!

I will have to take HOURS to go through all the wonderful work you did, particularly in finding that "portqry.exe" command that maybe can tell us what port the Android phone recently switched to (since that's the root of the problem!).

BTW, regarding the "adb connect" versus "adb pair", I think the difference is just in encryption (connect apparently isn't encrypted), where if that's the case, it doesn't matter which you use otherwise.

However, I could be wrong, so I had asked a while ago here, but nobody answered the question unfortunately.

What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?

Since you posted your script, here is my scrcpy script which gets rid of the console (but adb has to already be connected for it to work without the port number - which is how I use it most myself).

@echo off

REM C:\app\editor\android\scrcpy\showwin.bat
REM adb mdns services
REM List of discovered mdns services
REM netstat -ano -p tcp | findstr "192.168.1.10"
REM TCP 192.168.1.27:15919 192.168.1.10:41913 ESTABLISHED 7904
REM
cd /d "c:\app\editor\android\scrcpy"
certutil -f -decode %~f0 showwin.exe>nul
REM Port 5555 was needed when you established adb connections over USB
REM And then you disconnected the USB cable to subsequently work on Wi-Fi
REM But as of Android 11 or 12, you can establish the connection over Wi-Fi
REM But that "Developer option" "Wireless debugging" port is assigned by Android!
REM So you have to get it on Android or on Windows to know what it is
REM adb connect 192.168.1.10:5555
REM You can get the current port from the following command
REM c:\> netstat -ano -p tcp | findstr "192.168.1.10"
REM
REM maybe we do NOT need this command after all???
REM adb connect 192.168.1.10:41913

:: now we hide console window
showwin.exe 0

REM scrcpy --always-on-top --tcpip=192.168.1.10:5555
REM Maybe we can then remove the IP:PORT after all???
REM scrcpy --always-on-top --tcpip=192.168.1.10:41913
REM We don't really need --always-on-top after all???
REM scrcpy --always-on-top
scrcpy

:: after scrcpy is closed we show console window again
showwin.exe 5

del showwin.exe
goto :eof

-----BEGIN CERTIFICATE-----
TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAoAAA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AAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA==
-----END CERTIFICATE-----

In addition, if you run any free WebDAV server, you can mount your entire Android phone (even most of the read-only root partition!) as a drive letter onto Windows without having to use FTPUse to do it.

C:\> net use Z: \\192.168.0.2@8080\DavWWWRoot /USER:foo bar & net use Y: \\192.168.0.2@8081\DavWWWRoot /USER:foo bar

I had to use TWO free webdav servers though... one for the internal sdcard and one for the external sdcard - each on a different port - as nobody solved the problem I posed a while ago over here asking how to do it with just one webdav server.

Can you mount BOTH Android internal & external storage onto Windows as a drive letter over Wi-Fi using a SINGLE WebDAV server?