adb_shell icon indicating copy to clipboard operation
adb_shell copied to clipboard

Implement the pair command for Android 11+ devices

Open sharpordie opened this issue 2 years ago • 6 comments

It would be great to add this feature.

https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+

sharpordie avatar Jul 29 '22 14:07 sharpordie

I think this is the same as https://github.com/JeffLIrion/adb_shell/issues/175

JeffLIrion avatar Jul 29 '22 15:07 JeffLIrion

There are C++ and Java implementations. It looks kinda cryptic for me, but it could help you.

  • https://github.com/RikkaApps/Shizuku/blob/master/manager/src/main/jni/adb_pairing.cpp
  • https://github.com/MuntashirAkon/libadb-android/blob/master/libadb/src/main/java/io/github/muntashirakon/adb/PairingAuthCtx.java

sharpordie avatar Sep 04 '22 12:09 sharpordie

Any news on this ?

luzik avatar May 16 '23 19:05 luzik

I'm trying to implement this but STLS/Pair needs SPAKE that in turn needs the export_keying_materials OpenSSL function that is still not available for cpython3

https://github.com/python/cpython/pull/25255 https://github.com/python/cpython/issues/87931 https://github.com/python/cpython/pull/95366

I have a draft PR that implements STLS communication with already paired devices (pair through ADB or IntelliJ and then connect with adb_shell)

The only viable solutions are:

  • implement a custom ctype caller for the openssl OS library (this will work only in system with newer openssl>3.0)
  • use sslkeylog as a dependency https://sslkeylog.readthedocs.io/en/latest/index.html#sslkeylog.export_keying_material

TheZ3ro avatar May 17 '23 09:05 TheZ3ro

  • use sslkeylog as a dependency https://sslkeylog.readthedocs.io/en/latest/index.html#sslkeylog.export_keying_material

You could add that as an extra dependency (like libusb1 and aiofiles), especially if this feature should be considered experimental or if it will only work on certain platforms.

JeffLIrion avatar May 19 '23 04:05 JeffLIrion

This is an important request...

Neustradamus avatar Apr 16 '24 23:04 Neustradamus