Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
openclaw-android-node
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lisa
openclaw-android-node
Commits
e36c37af
Commit
e36c37af
authored
Mar 11, 2026
by
Lisa (AI Assistant)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Send pairing request when WebSocket closes due to device auth error
parent
4ba8722f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
buildOutputCleanup.lock
.gradle/buildOutputCleanup/buildOutputCleanup.lock
+0
-0
outputFiles.bin
.gradle/buildOutputCleanup/outputFiles.bin
+0
-0
PROJECT_LOG.md
PROJECT_LOG.md
+21
-2
NodeClient.kt
...n/java/com/nexlab/openclaw/node/data/remote/NodeClient.kt
+26
-2
No files found.
.gradle/buildOutputCleanup/buildOutputCleanup.lock
View file @
e36c37af
No preview for this file type
.gradle/buildOutputCleanup/outputFiles.bin
View file @
e36c37af
No preview for this file type
PROJECT_LOG.md
View file @
e36c37af
...
@@ -34,10 +34,29 @@
...
@@ -34,10 +34,29 @@
2.
**Client ID**
: Changed to "cli" (the only working client ID)
2.
**Client ID**
: Changed to "cli" (the only working client ID)
### Current Status (2026-03-11 1
6:4
5)
### Current Status (2026-03-11 1
7:1
5)
-
Build: Working ✅
-
Build: Working ✅
-
Install: Working ✅
-
Install: Working ✅
-
Pairing: STILL FAILING - need to rebuild APK with "cli" client ID ❌
-
Device Identity: PERSISTENT - uses RSA key pair stored in SharedPreferences ✅
-
Device ID:
`6a19599727bd964992898ac4251a9e08c52ae4740d2b0c927c11dc5d424a92bf`
✅
-
Client ID: "cli" ✅
-
Pairing: STILL FAILING - gateway rejects device signature (device not registered) ❌
### Analysis
-
Device identity persistence is working correctly (RSA key pair stored in SharedPreferences)
-
Gateway requires device registration - no UI to approve nodes
-
Cannot register device from here (no gateway API access)
-
Current device ID:
`6a19599727bd964992898ac4251a9e08c52ae4740d2b0c927c11dc5d424a92bf`
-
Token:
`415fa3c21b7ef06f22aff571697d88c59c2dc67737681267`
### Next Steps
1.
Either register this device manually via gateway UI (not possible from here)
2.
Or use a pre-registered device identity from the project
3.
Or modify gateway to accept this device signature
### Files Modified
-
`app/src/main/java/com/nexlab/openclaw/node/data/remote/NodeClient.kt`
- Added device identity persistence
-
`app/src/main/java/com/nexlab/openclaw/node/service/NodeService.kt`
- Added
`nodeClient.setContext(this)`
### Next Steps
### Next Steps
1.
**BLOCKED**
: Rebuild APK with "cli" client ID
1.
**BLOCKED**
: Rebuild APK with "cli" client ID
...
...
app/src/main/java/com/nexlab/openclaw/node/data/remote/NodeClient.kt
View file @
e36c37af
...
@@ -246,10 +246,14 @@ class NodeClient() {
...
@@ -246,10 +246,14 @@ class NodeClient() {
isPairingMode
=
false
isPairingMode
=
false
_connectionStatus
.
trySend
(
ConnectionStatus
(
true
,
nodeId
))
_connectionStatus
.
trySend
(
ConnectionStatus
(
true
,
nodeId
))
}
else
{
}
else
{
// Check if it's a device-required error
// Check if it's a device-required
or device signature
error
val
error
=
json
.
optJSONObject
(
"error"
)
?.
optString
(
"message"
,
"Connection failed"
)
val
error
=
json
.
optJSONObject
(
"error"
)
?.
optString
(
"message"
,
"Connection failed"
)
if
(
error
?.
contains
(
"device-required"
)
==
true
&&
isPairingMode
)
{
Log
.
d
(
TAG
,
"Connection failed with error: $error"
)
if
((
error
?.
contains
(
"device-required"
)
==
true
||
error
?.
contains
(
"device signature"
)
==
true
||
error
?.
contains
(
"invalid"
)
==
true
)
&&
isPairingMode
)
{
// Now send pairing request after connect failed
// Now send pairing request after connect failed
Log
.
d
(
TAG
,
"Sending pairing request after connection rejection"
)
sendPairingRequest
(
currentNodeId
,
currentToken
,
capabilities
)
sendPairingRequest
(
currentNodeId
,
currentToken
,
capabilities
)
}
else
{
}
else
{
_connectionStatus
.
trySend
(
ConnectionStatus
(
false
,
nodeId
))
_connectionStatus
.
trySend
(
ConnectionStatus
(
false
,
nodeId
))
...
@@ -271,12 +275,32 @@ class NodeClient() {
...
@@ -271,12 +275,32 @@ class NodeClient() {
override
fun
onClosing
(
webSocket
:
WebSocket
,
code
:
Int
,
reason
:
String
)
{
override
fun
onClosing
(
webSocket
:
WebSocket
,
code
:
Int
,
reason
:
String
)
{
Log
.
d
(
TAG
,
"WebSocket closing: code=$code reason=$reason"
)
Log
.
d
(
TAG
,
"WebSocket closing: code=$code reason=$reason"
)
// Check if it's a device signature error and we should send pairing request
if
(
isPairingMode
&&
(
reason
.
contains
(
"device signature"
)
||
reason
.
contains
(
"invalid"
)
||
reason
.
contains
(
"device-required"
)))
{
Log
.
d
(
TAG
,
"Connection rejected due to device auth, sending pairing request"
)
// Send pairing request after connection rejection
sendPairingRequest
(
currentNodeId
,
currentToken
,
capabilities
)
}
webSocket
.
close
(
1000
,
null
)
webSocket
.
close
(
1000
,
null
)
}
}
override
fun
onClosed
(
webSocket
:
WebSocket
,
code
:
Int
,
reason
:
String
)
{
override
fun
onClosed
(
webSocket
:
WebSocket
,
code
:
Int
,
reason
:
String
)
{
Log
.
d
(
TAG
,
"WebSocket closed: code=$code reason=$reason"
)
Log
.
d
(
TAG
,
"WebSocket closed: code=$code reason=$reason"
)
isConnected
=
false
isConnected
=
false
// Also check here in case onClosing didn't handle it
if
(
isPairingMode
&&
(
reason
.
contains
(
"device signature"
)
||
reason
.
contains
(
"invalid"
)
||
reason
.
contains
(
"device-required"
)))
{
Log
.
d
(
TAG
,
"Connection rejected due to device auth, sending pairing request"
)
sendPairingRequest
(
currentNodeId
,
currentToken
,
capabilities
)
return
}
_connectionStatus
.
trySend
(
ConnectionStatus
(
false
,
nodeId
))
_connectionStatus
.
trySend
(
ConnectionStatus
(
false
,
nodeId
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment