Commit dd734735 authored by Lisa (AI Assistant)'s avatar Lisa (AI Assistant)

Fix: Remove duplicate method, keep proper v3 signature handshake

parent ba4fd938
......@@ -333,66 +333,6 @@ class NodeClient() {
})
}
// Modified connect request without device auth
private fun sendConnectRequestWithChallenge(nodeId: String, token: String, capabilities: NodeCapabilities) {
pendingRequestId = "connect-${System.currentTimeMillis()}"
// Simplified connect request without device auth - just use the global token
val connectParams = JSONObject().apply {
put("minProtocol", 3)
put("maxProtocol", 3)
put("client", JSONObject().apply {
put("id", "cli") // Use "cli" client ID - only one that works with gateway
put("displayName", nodeId.ifBlank { "Android Node" })
put("version", "1.0.0")
put("platform", "android")
put("mode", "node")
})
put("role", "node")
put("scopes", JSONArray())
put("caps", JSONArray().apply {
if (capabilities.screenshot) put("screenshot")
if (capabilities.touch) put("touch")
if (capabilities.shell) put("shell")
if (capabilities.notifications) put("notifications")
if (capabilities.appControl) put("appControl")
if (capabilities.sensors) put("sensors")
})
put("commands", JSONArray().apply {
put("screenshot")
put("touch.*")
put("shell")
put("notifications")
put("app.launch")
put("device.info")
put("apps.list")
})
put("permissions", JSONObject())
put("auth", JSONObject().apply {
put("token", token)
})
put("device", JSONObject().apply {
put("id", "android-node") // Use fixed device ID
put("publicKey", "") // No public key
put("signature", "") // No signature
})
put("locale", "en-US")
put("userAgent", "openclaw-android/1.0.0")
}
val connectRequest = JSONObject().apply {
put("type", "req")
put("id", pendingRequestId)
put("method", "connect")
put("params", connectParams)
}
Log.d(TAG, "Sending connect request without device auth")
sendJson(connectRequest)
// Don't send pairing request here - wait for connect response first
}
private fun sendConnectRequest(nodeId: String, token: String, capabilities: NodeCapabilities) {
pendingRequestId = "connect-${System.currentTimeMillis()}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment