openclaw-droid 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of openclaw-droid might be problematic. Click here for more details.
- package/README.md +14 -25
- package/hijack.js +2 -0
- package/install.sh +66 -30
- package/package.json +2 -2
- package/patch.js +0 -15
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Turn your Android device into a 24/7 AI Gateway using OpenClaw with proot-distro
|
|
|
15
15
|
|
|
16
16
|
- **Android**: 10 or newer
|
|
17
17
|
- **Termux**: F-Droid version only (https://f-droid.org/packages/com.termux/)
|
|
18
|
-
- **API Key**:
|
|
18
|
+
- **API Key**: Gemini API key from Google AI Studio
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
@@ -76,46 +76,35 @@ npm install -g openclaw
|
|
|
76
76
|
|
|
77
77
|
**Step 7: Create network interface patch**
|
|
78
78
|
```bash
|
|
79
|
-
cat << 'EOF' > /root/
|
|
79
|
+
cat << 'EOF' > /root/hijack.js
|
|
80
80
|
const os = require('os');
|
|
81
|
-
os.networkInterfaces =
|
|
82
|
-
return {
|
|
83
|
-
"lo": [
|
|
84
|
-
{
|
|
85
|
-
"address": "127.0.0.1",
|
|
86
|
-
"netmask": "255.0.0.0",
|
|
87
|
-
"family": "IPv4",
|
|
88
|
-
"mac": "00:00:00:00:00:00",
|
|
89
|
-
"internal": true,
|
|
90
|
-
"cidr": "127.0.0.1/8"
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
};
|
|
94
|
-
};
|
|
81
|
+
os.networkInterfaces = () => ({});
|
|
95
82
|
EOF
|
|
96
83
|
```
|
|
97
84
|
|
|
98
85
|
**Step 8: Configure environment**
|
|
99
86
|
```bash
|
|
100
|
-
echo
|
|
87
|
+
echo 'export NODE_OPTIONS="-r /root/hijack.js"' >> ~/.bashrc
|
|
88
|
+
source ~/.bashrc
|
|
101
89
|
```
|
|
102
90
|
|
|
103
91
|
**Step 9: Run onboarding**
|
|
104
92
|
```bash
|
|
105
|
-
export NODE_OPTIONS='--require /root/patch.js'
|
|
106
93
|
openclaw onboard
|
|
107
94
|
```
|
|
108
95
|
|
|
96
|
+
When asked for Gateway Bind, select **Loopback (127.0.0.1)**.
|
|
97
|
+
|
|
109
98
|
**Step 10: Start the gateway**
|
|
110
99
|
```bash
|
|
111
|
-
openclaw gateway --
|
|
100
|
+
openclaw gateway --verbose
|
|
112
101
|
```
|
|
113
102
|
|
|
114
103
|
## Usage
|
|
115
104
|
|
|
116
105
|
### Start the AI Gateway
|
|
117
106
|
```bash
|
|
118
|
-
openclaw gateway --
|
|
107
|
+
openclaw gateway --verbose
|
|
119
108
|
```
|
|
120
109
|
|
|
121
110
|
### Run onboarding wizard
|
|
@@ -138,7 +127,7 @@ openclaw --help
|
|
|
138
127
|
Once the gateway is running, open your browser to:
|
|
139
128
|
|
|
140
129
|
```
|
|
141
|
-
http://127.0.0.1:18789
|
|
130
|
+
http://127.0.0.1:18789
|
|
142
131
|
```
|
|
143
132
|
|
|
144
133
|
## Troubleshooting
|
|
@@ -146,10 +135,10 @@ http://127.0.0.1:18789/chat?
|
|
|
146
135
|
### Gateway not starting
|
|
147
136
|
- Ensure Ubuntu container is running: `proot-distro login ubuntu`
|
|
148
137
|
- Check Node.js version: `node -v` (should be v22.x)
|
|
149
|
-
- Verify network patch is applied: `ls /root/
|
|
138
|
+
- Verify network patch is applied: `ls /root/hijack.js`
|
|
150
139
|
|
|
151
140
|
### Network interface errors
|
|
152
|
-
- The
|
|
141
|
+
- The hijack.js file fixes Android network restrictions
|
|
153
142
|
- Make sure `NODE_OPTIONS` is set: `echo $NODE_OPTIONS`
|
|
154
143
|
- Reapply the patch if needed
|
|
155
144
|
|
|
@@ -169,7 +158,7 @@ http://127.0.0.1:18789/chat?
|
|
|
169
158
|
pkg install tmux -y
|
|
170
159
|
tmux new -s openclaw
|
|
171
160
|
proot-distro login ubuntu
|
|
172
|
-
openclaw gateway --
|
|
161
|
+
openclaw gateway --verbose
|
|
173
162
|
```
|
|
174
163
|
|
|
175
164
|
Detach with `Ctrl+b` then `d`. Reattach with `tmux attach -t openclaw`.
|
|
@@ -185,7 +174,7 @@ npm update -g openclaw
|
|
|
185
174
|
```
|
|
186
175
|
openclaw-droid/
|
|
187
176
|
├── install.sh # Main installer script
|
|
188
|
-
├──
|
|
177
|
+
├── hijack.js # Network interface patch
|
|
189
178
|
├── README.md # This file
|
|
190
179
|
├── LICENSE # MIT License
|
|
191
180
|
└── package.json # NPM package configuration
|
package/hijack.js
ADDED
package/install.sh
CHANGED
|
@@ -9,8 +9,8 @@ NC='\033[0m'
|
|
|
9
9
|
|
|
10
10
|
echo -e "${BLUE}"
|
|
11
11
|
echo "╔═══════════════════════════════════════════╗"
|
|
12
|
-
echo "║ OPENCLAW DROID INSTALLER
|
|
13
|
-
echo "║
|
|
12
|
+
echo "║ OPENCLAW DROID INSTALLER ║"
|
|
13
|
+
echo "║ NosytLabs ║"
|
|
14
14
|
echo "╚═══════════════════════════════════════════╝"
|
|
15
15
|
echo -e "${NC}"
|
|
16
16
|
|
|
@@ -25,37 +25,36 @@ echo -e "\n${BLUE}[1/6]${NC} Updating Termux packages..."
|
|
|
25
25
|
export DEBIAN_FRONTEND=noninteractive
|
|
26
26
|
|
|
27
27
|
# Attempt update, but don't exit if it fails (common due to repo mirrors or dependency conflicts)
|
|
28
|
-
# We use -o Dpkg::Options::="--force-confnew" to automatically accept new config files
|
|
29
28
|
if ! pkg update -y -o Dpkg::Options::="--force-confnew" || ! pkg upgrade -y -o Dpkg::Options::="--force-confnew"; then
|
|
30
29
|
echo -e "${YELLOW}Warning: Termux package update had issues.${NC}"
|
|
31
30
|
echo -e "Attempting to proceed. If installation fails, try running 'pkg remove nodejs' manually."
|
|
32
31
|
fi
|
|
33
32
|
|
|
34
33
|
echo -e "\n${BLUE}[2/6]${NC} Installing proot-distro..."
|
|
35
|
-
# Check if proot-distro is already installed to avoid re-installation issues
|
|
36
34
|
if command -v proot-distro &> /dev/null; then
|
|
37
35
|
echo -e " ${GREEN}✓${NC} proot-distro already installed."
|
|
38
36
|
else
|
|
39
37
|
if ! pkg install proot-distro -y; then
|
|
40
38
|
echo -e "${RED}Error:${NC} Failed to install proot-distro."
|
|
41
|
-
echo -e "${YELLOW}Tip:${NC} Try running 'pkg remove nodejs' if you have dependency conflicts
|
|
39
|
+
echo -e "${YELLOW}Tip:${NC} Try running 'pkg remove nodejs' if you have dependency conflicts."
|
|
42
40
|
exit 1
|
|
43
41
|
fi
|
|
44
42
|
fi
|
|
45
43
|
|
|
46
|
-
echo -e "\n${BLUE}[3/6]${NC}
|
|
47
|
-
if
|
|
48
|
-
|
|
44
|
+
echo -e "\n${BLUE}[3/6]${NC} Checking Ubuntu container..."
|
|
45
|
+
# We don't skip the setup if it exists; we just ensure it's installed.
|
|
46
|
+
if proot-distro list | grep -q "ubuntu (installed)"; then
|
|
47
|
+
echo -e " ${GREEN}✓${NC} Ubuntu container found. Proceeding to configuration..."
|
|
49
48
|
else
|
|
50
49
|
echo -e " ${YELLOW}Installing Ubuntu...${NC}"
|
|
51
50
|
if ! proot-distro install ubuntu; then
|
|
52
51
|
echo -e "${RED}Error:${NC} Failed to install Ubuntu container."
|
|
53
|
-
echo -e "Check your internet connection and disk space."
|
|
54
52
|
exit 1
|
|
55
53
|
fi
|
|
56
54
|
fi
|
|
57
55
|
|
|
58
|
-
echo -e "\n${BLUE}[4/6]${NC} Configuring auto-login..."
|
|
56
|
+
echo -e "\n${BLUE}[4/6]${NC} Configuring auto-login (optional)..."
|
|
57
|
+
# We won't force auto-login if the user doesn't want it, but we'll add it if missing to match user request
|
|
59
58
|
if ! grep -q "proot-distro login ubuntu" ~/.bashrc; then
|
|
60
59
|
echo "proot-distro login ubuntu" >> ~/.bashrc
|
|
61
60
|
echo -e " ${GREEN}✓${NC} Auto-login configured."
|
|
@@ -67,6 +66,7 @@ echo -e "\n${BLUE}[5/6]${NC} Creating internal setup script..."
|
|
|
67
66
|
TERMUX_HOME="$HOME"
|
|
68
67
|
INTERNAL_SCRIPT="$TERMUX_HOME/openclaw_internal_setup.sh"
|
|
69
68
|
|
|
69
|
+
# Create the internal script that runs INSIDE Ubuntu
|
|
70
70
|
cat << 'EOF' > "$INTERNAL_SCRIPT"
|
|
71
71
|
#!/bin/bash
|
|
72
72
|
set -e
|
|
@@ -76,29 +76,49 @@ BLUE='\033[0;34m'
|
|
|
76
76
|
YELLOW='\033[1;33m'
|
|
77
77
|
NC='\033[0m'
|
|
78
78
|
|
|
79
|
-
echo -e "\n${BLUE}[
|
|
79
|
+
echo -e "\n${BLUE}[Internal]${NC} Configuring OpenClaw environment..."
|
|
80
80
|
|
|
81
|
-
#
|
|
81
|
+
# 1. Fix Package Manager
|
|
82
|
+
echo -e "${YELLOW}Updating Ubuntu repositories...${NC}"
|
|
83
|
+
export DEBIAN_FRONTEND=noninteractive
|
|
82
84
|
rm -f /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock
|
|
83
85
|
dpkg --configure -a || true
|
|
86
|
+
apt update -y
|
|
87
|
+
apt upgrade -y -o Dpkg::Options::="--force-confnew"
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
apt
|
|
89
|
+
# 2. Install Dependencies
|
|
90
|
+
echo -e "${YELLOW}Installing core dependencies...${NC}"
|
|
91
|
+
apt install curl git build-essential -y
|
|
88
92
|
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
# 3. Install Node.js 22
|
|
94
|
+
echo -e "${YELLOW}Installing Node.js 22...${NC}"
|
|
91
95
|
if ! command -v node &> /dev/null; then
|
|
92
96
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
93
97
|
apt install -y nodejs
|
|
94
98
|
else
|
|
95
|
-
echo -e " ${GREEN}✓${NC} Node.js
|
|
99
|
+
echo -e " ${GREEN}✓${NC} Node.js $(node -v) is installed."
|
|
96
100
|
fi
|
|
97
101
|
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
# 4. Install OpenClaw
|
|
103
|
+
echo -e "${YELLOW}Installing OpenClaw global package...${NC}"
|
|
104
|
+
npm install -g openclaw@latest
|
|
105
|
+
|
|
106
|
+
# Verify installation path
|
|
107
|
+
if ! command -v openclaw &> /dev/null; then
|
|
108
|
+
echo -e "${YELLOW}Warning: 'openclaw' command not found in PATH.${NC}"
|
|
109
|
+
echo -e "Searching for binary..."
|
|
110
|
+
POSSIBLE_PATH=$(find / -name openclaw -type l 2>/dev/null | head -n 1)
|
|
111
|
+
if [ -n "$POSSIBLE_PATH" ]; then
|
|
112
|
+
echo -e "Found at: $POSSIBLE_PATH"
|
|
113
|
+
ln -sf "$POSSIBLE_PATH" /usr/bin/openclaw
|
|
114
|
+
echo -e "${GREEN}✓${NC} Symlinked to /usr/bin/openclaw"
|
|
115
|
+
else
|
|
116
|
+
echo -e "${RED}Error:${NC} Could not find openclaw binary. Installation may have failed."
|
|
117
|
+
fi
|
|
118
|
+
fi
|
|
100
119
|
|
|
101
|
-
|
|
120
|
+
# 5. Create Bionic Bypass (Patch)
|
|
121
|
+
echo -e "${YELLOW}Creating network interface patch (patch.js)...${NC}"
|
|
102
122
|
cat << 'JS' > /root/patch.js
|
|
103
123
|
const os = require('os');
|
|
104
124
|
os.networkInterfaces = function() {
|
|
@@ -117,27 +137,43 @@ os.networkInterfaces = function() {
|
|
|
117
137
|
};
|
|
118
138
|
JS
|
|
119
139
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
140
|
+
# 6. Configure Environment
|
|
141
|
+
echo -e "${YELLOW}Configuring environment variables...${NC}"
|
|
142
|
+
# Add to .bashrc if not present
|
|
143
|
+
if ! grep -q "patch.js" /root/.bashrc; then
|
|
144
|
+
echo 'export NODE_OPTIONS="--require /root/patch.js"' >> /root/.bashrc
|
|
123
145
|
fi
|
|
146
|
+
# Add to .profile for good measure
|
|
147
|
+
if ! grep -q "patch.js" /root/.profile; then
|
|
148
|
+
echo 'export NODE_OPTIONS="--require /root/patch.js"' >> /root/.profile
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
# Apply immediately for this session
|
|
152
|
+
export NODE_OPTIONS="--require /root/patch.js"
|
|
124
153
|
|
|
125
|
-
echo -e "\n${GREEN}Starting OpenClaw
|
|
126
|
-
|
|
127
|
-
|
|
154
|
+
echo -e "\n${GREEN}Starting OpenClaw Onboarding...${NC}"
|
|
155
|
+
echo -e "${YELLOW}IMPORTANT: Select 'Loopback (127.0.0.1)' for Gateway Bind!${NC}"
|
|
156
|
+
|
|
157
|
+
# Run onboarding if user wants, or they can do it later.
|
|
158
|
+
# We'll try running it. If it fails (e.g. user cancels), we don't want the script to exit with error.
|
|
159
|
+
openclaw onboard || echo -e "${YELLOW}Onboarding finished or skipped.${NC}"
|
|
128
160
|
|
|
129
161
|
echo -e "\n${GREEN}╔═══════════════════════════════════════════╗${NC}"
|
|
130
162
|
echo -e "${GREEN}║ INSTALLATION COMPLETE! ║${NC}"
|
|
131
163
|
echo -e "${GREEN}╚═══════════════════════════════════════════╝${NC}"
|
|
164
|
+
echo -e "Type ${BLUE}openclaw gateway${NC} to start."
|
|
132
165
|
EOF
|
|
133
166
|
|
|
134
167
|
chmod +x "$INTERNAL_SCRIPT"
|
|
135
168
|
|
|
136
|
-
echo -e "\n${BLUE}Entering Ubuntu
|
|
137
|
-
|
|
169
|
+
echo -e "\n${BLUE}[6/6]${NC} Entering Ubuntu to finalize setup..."
|
|
170
|
+
echo -e "Please wait while we configure the container..."
|
|
171
|
+
|
|
172
|
+
# Run the internal script inside Ubuntu
|
|
173
|
+
# We bind the home directory to access the script
|
|
138
174
|
proot-distro login ubuntu --bind "$TERMUX_HOME":/mnt/termux -- bash /mnt/termux/openclaw_internal_setup.sh
|
|
139
175
|
|
|
140
|
-
echo -e "\n${GREEN}Cleaning up
|
|
176
|
+
echo -e "\n${GREEN}Cleaning up...${NC}"
|
|
141
177
|
rm -f "$INTERNAL_SCRIPT"
|
|
142
178
|
|
|
143
179
|
echo -e "\n${BLUE}Logging you into Ubuntu now...${NC}"
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-droid",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "OpenClaw Droid - Android AI Gateway Installer with proot-distro Ubuntu",
|
|
5
5
|
"files": [
|
|
6
6
|
"install.sh",
|
|
7
|
-
"
|
|
7
|
+
"hijack.js",
|
|
8
8
|
"README.md",
|
|
9
9
|
"LICENSE"
|
|
10
10
|
],
|
package/patch.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const os = require('os');
|
|
2
|
-
os.networkInterfaces = function() {
|
|
3
|
-
return {
|
|
4
|
-
"lo": [
|
|
5
|
-
{
|
|
6
|
-
"address": "127.0.0.1",
|
|
7
|
-
"netmask": "255.0.0.0",
|
|
8
|
-
"family": "IPv4",
|
|
9
|
-
"mac": "00:00:00:00:00:00",
|
|
10
|
-
"internal": true,
|
|
11
|
-
"cidr": "127.0.0.1/8"
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
};
|
|
15
|
-
};
|