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
45e5fad5
Commit
45e5fad5
authored
Mar 11, 2026
by
Lisa (AI Assistant)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip device signature on initial connect - use token auth only until paired
parent
31729b43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
27 deletions
+38
-27
NodeClient.kt
...n/java/com/nexlab/openclaw/node/data/remote/NodeClient.kt
+38
-27
No files found.
app/src/main/java/com/nexlab/openclaw/node/data/remote/NodeClient.kt
View file @
45e5fad5
...
@@ -272,7 +272,8 @@ class NodeClient() {
...
@@ -272,7 +272,8 @@ class NodeClient() {
// Get the token from the response and reconnect
// Get the token from the response and reconnect
val
newToken
=
json
.
optJSONObject
(
"payload"
)
?.
optString
(
"token"
,
""
)
?:
""
val
newToken
=
json
.
optJSONObject
(
"payload"
)
?.
optString
(
"token"
,
""
)
?:
""
isPairingMode
=
false
isPairingMode
=
false
sendConnectRequestWithChallenge
(
nodeId
,
newToken
,
capabilities
)
// After pairing, include device info for authenticated connection
sendConnectRequestWithChallenge
(
nodeId
,
newToken
,
capabilities
,
includeDevice
=
true
)
}
}
}
}
}
}
...
@@ -365,7 +366,7 @@ class NodeClient() {
...
@@ -365,7 +366,7 @@ class NodeClient() {
})
})
}
}
private
fun
sendConnectRequest
(
nodeId
:
String
,
token
:
String
,
capabilities
:
NodeCapabilities
)
{
private
fun
sendConnectRequest
(
nodeId
:
String
,
token
:
String
,
capabilities
:
NodeCapabilities
,
includeDevice
:
Boolean
=
false
)
{
pendingRequestId
=
"connect-${System.currentTimeMillis()}"
pendingRequestId
=
"connect-${System.currentTimeMillis()}"
val
connectParams
=
JSONObject
().
apply
{
val
connectParams
=
JSONObject
().
apply
{
...
@@ -401,12 +402,15 @@ class NodeClient() {
...
@@ -401,12 +402,15 @@ class NodeClient() {
put
(
"auth"
,
JSONObject
().
apply
{
put
(
"auth"
,
JSONObject
().
apply
{
put
(
"token"
,
token
)
put
(
"token"
,
token
)
})
})
put
(
"device"
,
JSONObject
().
apply
{
// Only include device info if explicitly requested (after pairing)
put
(
"id"
,
deviceId
)
if
(
includeDevice
)
{
put
(
"publicKey"
,
devicePublicKey
)
put
(
"device"
,
JSONObject
().
apply
{
put
(
"si"
,
deviceId
)
// Service identity = device ID
put
(
"id"
,
deviceId
)
put
(
"signature"
,
signData
(
token
))
// Sign the token
put
(
"publicKey"
,
devicePublicKey
)
})
put
(
"si"
,
deviceId
)
// Service identity = device ID
put
(
"signature"
,
signData
(
token
))
// Sign the token
})
}
put
(
"locale"
,
"en-US"
)
put
(
"locale"
,
"en-US"
)
put
(
"userAgent"
,
"openclaw-android/1.0.0"
)
put
(
"userAgent"
,
"openclaw-android/1.0.0"
)
}
}
...
@@ -421,22 +425,26 @@ class NodeClient() {
...
@@ -421,22 +425,26 @@ class NodeClient() {
sendJson
(
connectRequest
)
sendJson
(
connectRequest
)
}
}
private
fun
sendConnectRequestWithChallenge
(
nodeId
:
String
,
token
:
String
,
capabilities
:
NodeCapabilities
)
{
private
fun
sendConnectRequestWithChallenge
(
nodeId
:
String
,
token
:
String
,
capabilities
:
NodeCapabilities
,
includeDevice
:
Boolean
=
false
)
{
pendingRequestId
=
"connect-${System.currentTimeMillis()}"
pendingRequestId
=
"connect-${System.currentTimeMillis()}"
// Use v3 signature format
// Use v3 signature format
- only if including device info
val
scopesArray
=
JSONArray
()
val
scopesArray
=
JSONArray
()
// Sign the v3 payload - clientId should be deviceId
// Only generate signature if we're including device info
val
signature
=
signV3Payload
(
val
signature
=
if
(
includeDevice
)
{
nonce
=
challengeNonce
,
signV3Payload
(
clientId
=
deviceId
,
// Use device ID for signature
nonce
=
challengeNonce
,
role
=
"node"
,
clientId
=
deviceId
,
// Use device ID for signature
scopes
=
scopesArray
,
role
=
"node"
,
token
=
token
,
scopes
=
scopesArray
,
platform
=
"android"
,
token
=
token
,
deviceFamily
=
"phone"
platform
=
"android"
,
)
deviceFamily
=
"phone"
)
}
else
{
""
}
val
connectParams
=
JSONObject
().
apply
{
val
connectParams
=
JSONObject
().
apply
{
put
(
"minProtocol"
,
3
)
put
(
"minProtocol"
,
3
)
...
@@ -471,13 +479,16 @@ class NodeClient() {
...
@@ -471,13 +479,16 @@ class NodeClient() {
put
(
"auth"
,
JSONObject
().
apply
{
put
(
"auth"
,
JSONObject
().
apply
{
put
(
"token"
,
token
)
put
(
"token"
,
token
)
})
})
put
(
"device"
,
JSONObject
().
apply
{
// Only include device info if explicitly requested (after pairing)
put
(
"id"
,
deviceId
)
if
(
includeDevice
)
{
put
(
"publicKey"
,
devicePublicKey
)
put
(
"device"
,
JSONObject
().
apply
{
put
(
"signature"
,
signature
)
put
(
"id"
,
deviceId
)
put
(
"signedAt"
,
challengeTimestamp
)
put
(
"publicKey"
,
devicePublicKey
)
put
(
"nonce"
,
challengeNonce
)
put
(
"signature"
,
signature
)
})
put
(
"signedAt"
,
challengeTimestamp
)
put
(
"nonce"
,
challengeNonce
)
})
}
put
(
"locale"
,
"en-US"
)
put
(
"locale"
,
"en-US"
)
put
(
"userAgent"
,
"openclaw-android/1.0.0"
)
put
(
"userAgent"
,
"openclaw-android/1.0.0"
)
}
}
...
...
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