Skip to content

[Bug]ADB Wireless pairing fails due to Non-SDK Hidden API restriction on Android 14+ (Conscrypt exportKeyingMaterial) #124

Description

@yangyws

Describe the Bug

When attempting to use ADB Wireless Auto-Setup / Pairing on devices running Android 14 (API 34) or later, the pairing handshake fails due to non-SDK hidden API reflection restrictions blocking com.android.org.conscrypt.Conscrypt.exportKeyingMaterial.

Steps to Reproduce

  1. Launch Megingiard on an Android 14 device (e.g., AYN Thor handheld).
  2. Open Privileged Mode Setup -> Wireless ADB Auto-Setup / Pairing.
  3. Input the pairing code and port from Developer Options -> Wireless Debugging.
  4. Attempt to pair.
  5. Pairing fails to establish the TLS session because hidden API reflection is blocked by the Android runtime.

Observed Behavior & Logs

During the TLS 1.3 pairing handshake, libadb-android uses reflection to call Conscrypt's exportKeyingMaterial:

java.lang.NoSuchMethodException: com.android.org.conscrypt.Conscrypt.exportKeyingMaterial [interface javax.net.ssl.SSLEngine, class [B, class [B, int]
    at java.lang.Class.getMethod(Class.java:2311)
    at io.github.muntashirakon.adb.AdbPairingTlsConnection...

Because modern Android versions (Android 14 / API 34+) enforce strict non-SDK interface restrictions on hidden classes, ART denies reflection access into com.android.org.conscrypt.*, resulting in NoSuchMethodException and causing auto-setup / pairing to fail.

Device / Environment Details

  • Device: AYN Thor dual-screen handheld
  • OS Version: Android 14 (API Level 34)
  • Megingiard Version: 0.8.0 / 0.9.0-dev

Proposed Solution

Refer to PR #121 for a proposed fix using org.lsposed.hiddenapibypass:hiddenapibypass:4.3 to exempt hidden API restrictions during pairing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions