devicely 2.1.3 → 2.1.5
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.
- package/bin/devicely.js +105 -1
- package/lib/androidDeviceDetection.js +276 -1
- package/lib/appMappings.js +337 -1
- package/lib/deviceDetection.js +394 -1
- package/lib/devices.js +54 -1
- package/lib/doctor.js +94 -1
- package/lib/executor.js +104 -1
- package/lib/logger.js +35 -1
- package/lib/scriptLoader.js +75 -0
- package/lib/server.js +3483 -1
- package/package.json +3 -12
- package/scripts/compile-shell-scripts.js +208 -0
- package/scripts/encrypt-shell-simple.js +75 -0
- package/scripts/obfuscate-shell.js +160 -0
- package/scripts/shell/android_device_control +0 -0
- package/scripts/shell/android_device_control.sh +848 -0
- package/scripts/shell/apps_presets.conf +271 -0
- package/scripts/shell/connect_android_usb +0 -0
- package/scripts/shell/connect_android_usb_multi_final +0 -0
- package/scripts/shell/connect_android_usb_multi_final.sh +289 -0
- package/scripts/shell/connect_android_wireless +0 -0
- package/scripts/shell/connect_android_wireless.sh +58 -0
- package/scripts/shell/connect_android_wireless_multi_final +0 -0
- package/scripts/shell/connect_android_wireless_multi_final.sh +476 -0
- package/scripts/shell/connect_ios_usb +0 -0
- package/scripts/shell/connect_ios_usb_multi_final +0 -0
- package/scripts/shell/connect_ios_usb_multi_final.sh +4225 -0
- package/scripts/shell/connect_ios_wireless_multi_final +0 -0
- package/scripts/shell/connect_ios_wireless_multi_final.sh +4167 -0
- package/scripts/shell/create_production_scripts +0 -0
- package/scripts/shell/create_production_scripts.sh +38 -0
- package/scripts/shell/devices.conf +24 -0
- package/scripts/shell/diagnose_wireless_ios +0 -0
- package/scripts/shell/find_element_coordinates +0 -0
- package/scripts/shell/find_wda +0 -0
- package/scripts/shell/install_uiautomator2 +0 -0
- package/scripts/shell/install_uiautomator2.sh +93 -0
- package/scripts/shell/ios_device_control +0 -0
- package/scripts/shell/ios_device_control.sh +220 -0
- package/scripts/shell/organize_project +0 -0
- package/scripts/shell/organize_project.sh +59 -0
- package/scripts/shell/pre-publish-check +0 -0
- package/scripts/shell/pre-publish-check.sh +238 -0
- package/scripts/shell/publish +0 -0
- package/scripts/shell/publish-to-npm +0 -0
- package/scripts/shell/publish-to-npm.sh +366 -0
- package/scripts/shell/publish.sh +100 -0
- package/scripts/shell/setup +0 -0
- package/scripts/shell/setup.sh +121 -0
- package/scripts/shell/setup_android +0 -0
- package/scripts/shell/start +0 -0
- package/scripts/shell/start.sh +59 -0
- package/scripts/shell/sync-to-npm-package-final +0 -0
- package/scripts/shell/sync-to-npm-package-final.sh +60 -0
- package/scripts/shell/test-local-package.sh +95 -0
- package/scripts/shell/test_android_locators +0 -0
- package/scripts/shell/test_connect +0 -0
- package/scripts/shell/test_device_detection +0 -0
- package/scripts/shell/test_fixes +0 -0
- package/scripts/shell/test_getlocators_fix +0 -0
- package/scripts/shell/test_recording_feature +0 -0
- package/scripts/shell/verify-shell-protection +0 -0
- package/scripts/shell/verify-shell-protection.sh +73 -0
- package/scripts/shell/verify_distribution +0 -0
- package/lib/package-lock.json +0 -1678
- package/lib/package.json +0 -30
- package/lib/screenshots/screenshot_ios_iPhone17_20260205_225900.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhone17_20260205_225942.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhone17_20260205_231101.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhone17_20260205_232911.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhone17_20260208_095103.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhone17_20260208_095720.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115040.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115047.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115118.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115125.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_115143.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120107.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120118.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120137.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_120201.png +0 -0
- package/lib/screenshots/screenshot_ios_iPhoneXR17x_20260206_134529.png +0 -0
- package/scripts/shell/android_device_control.enc +0 -1
- package/scripts/shell/connect_android_usb_multi_final.enc +0 -1
- package/scripts/shell/connect_android_wireless.enc +0 -1
- package/scripts/shell/connect_android_wireless_multi_final.enc +0 -1
- package/scripts/shell/connect_ios_usb_multi_final.enc +0 -1
- package/scripts/shell/connect_ios_wireless_multi_final.enc +0 -1
- package/scripts/shell/ios_device_control.enc +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
###############################################################################
|
|
4
|
+
# QUICK PUBLISH HELPER
|
|
5
|
+
# Interactive wrapper for publish-to-npm.sh
|
|
6
|
+
###############################################################################
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
# Colors
|
|
11
|
+
RED='\033[0;31m'
|
|
12
|
+
GREEN='\033[0;32m'
|
|
13
|
+
YELLOW='\033[1;33m'
|
|
14
|
+
BLUE='\033[0;34m'
|
|
15
|
+
CYAN='\033[0;36m'
|
|
16
|
+
MAGENTA='\033[0;35m'
|
|
17
|
+
NC='\033[0m'
|
|
18
|
+
|
|
19
|
+
clear
|
|
20
|
+
|
|
21
|
+
echo -e "${CYAN}"
|
|
22
|
+
cat << "EOF"
|
|
23
|
+
╔════════════════════════════════════════════════╗
|
|
24
|
+
║ ║
|
|
25
|
+
║ 📦 NPM PUBLISH HELPER 📦 ║
|
|
26
|
+
║ ║
|
|
27
|
+
║ Quick Publish Menu ║
|
|
28
|
+
║ ║
|
|
29
|
+
╚════════════════════════════════════════════════╝
|
|
30
|
+
EOF
|
|
31
|
+
echo -e "${NC}"
|
|
32
|
+
|
|
33
|
+
# Get current version
|
|
34
|
+
CURRENT_VERSION=$(node -p "require('./npm-package/package.json').version" 2>/dev/null || echo "unknown")
|
|
35
|
+
echo -e "${YELLOW}Current Version:${NC} ${MAGENTA}$CURRENT_VERSION${NC}\n"
|
|
36
|
+
|
|
37
|
+
# Calculate potential versions
|
|
38
|
+
if [[ "$CURRENT_VERSION" != "unknown" ]]; then
|
|
39
|
+
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
|
|
40
|
+
PATCH_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$((VERSION_PARTS[2] + 1))"
|
|
41
|
+
MINOR_VERSION="${VERSION_PARTS[0]}.$((VERSION_PARTS[1] + 1)).0"
|
|
42
|
+
MAJOR_VERSION="$((VERSION_PARTS[0] + 1)).0.0"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo -e "${CYAN}What type of release?${NC}\n"
|
|
46
|
+
echo -e "${GREEN}1)${NC} Patch - Bug fixes ${MAGENTA}($CURRENT_VERSION → $PATCH_VERSION)${NC}"
|
|
47
|
+
echo -e "${GREEN}2)${NC} Minor - New features ${MAGENTA}($CURRENT_VERSION → $MINOR_VERSION)${NC}"
|
|
48
|
+
echo -e "${GREEN}3)${NC} Major - Breaking changes ${MAGENTA}($CURRENT_VERSION → $MAJOR_VERSION)${NC}"
|
|
49
|
+
echo ""
|
|
50
|
+
echo -e "${YELLOW}4)${NC} Dry Run - Test without publishing"
|
|
51
|
+
echo -e "${RED}5)${NC} Cancel"
|
|
52
|
+
echo ""
|
|
53
|
+
|
|
54
|
+
read -p "Enter choice [1-5]: " choice
|
|
55
|
+
|
|
56
|
+
case $choice in
|
|
57
|
+
1)
|
|
58
|
+
echo -e "\n${CYAN}Publishing patch version...${NC}\n"
|
|
59
|
+
./publish-to-npm.sh patch
|
|
60
|
+
;;
|
|
61
|
+
2)
|
|
62
|
+
echo -e "\n${CYAN}Publishing minor version...${NC}\n"
|
|
63
|
+
./publish-to-npm.sh minor
|
|
64
|
+
;;
|
|
65
|
+
3)
|
|
66
|
+
echo -e "\n${RED}⚠️ Major version! This indicates breaking changes.${NC}"
|
|
67
|
+
read -p "Are you sure? (yes/no): " confirm
|
|
68
|
+
if [[ "$confirm" == "yes" ]]; then
|
|
69
|
+
echo -e "\n${CYAN}Publishing major version...${NC}\n"
|
|
70
|
+
./publish-to-npm.sh major
|
|
71
|
+
else
|
|
72
|
+
echo -e "${YELLOW}Cancelled${NC}"
|
|
73
|
+
fi
|
|
74
|
+
;;
|
|
75
|
+
4)
|
|
76
|
+
echo -e "\n${CYAN}Choose version type for dry run:${NC}\n"
|
|
77
|
+
echo "1) Patch"
|
|
78
|
+
echo "2) Minor"
|
|
79
|
+
echo "3) Major"
|
|
80
|
+
read -p "Enter choice [1-3]: " dry_choice
|
|
81
|
+
|
|
82
|
+
case $dry_choice in
|
|
83
|
+
1) VERSION_TYPE="patch" ;;
|
|
84
|
+
2) VERSION_TYPE="minor" ;;
|
|
85
|
+
3) VERSION_TYPE="major" ;;
|
|
86
|
+
*) echo -e "${RED}Invalid choice${NC}"; exit 1 ;;
|
|
87
|
+
esac
|
|
88
|
+
|
|
89
|
+
echo -e "\n${CYAN}Running dry run with $VERSION_TYPE...${NC}\n"
|
|
90
|
+
./publish-to-npm.sh $VERSION_TYPE --dry-run
|
|
91
|
+
;;
|
|
92
|
+
5)
|
|
93
|
+
echo -e "${YELLOW}Cancelled${NC}"
|
|
94
|
+
exit 0
|
|
95
|
+
;;
|
|
96
|
+
*)
|
|
97
|
+
echo -e "${RED}Invalid choice${NC}"
|
|
98
|
+
exit 1
|
|
99
|
+
;;
|
|
100
|
+
esac
|
|
Binary file
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# iOS Device Mind Control - Setup Script
|
|
4
|
+
# This script sets up the web application for the first time
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
echo "🚀 iOS Device Mind Control - Setup"
|
|
9
|
+
echo "===================================="
|
|
10
|
+
echo ""
|
|
11
|
+
|
|
12
|
+
# Colors
|
|
13
|
+
GREEN='\033[0;32m'
|
|
14
|
+
YELLOW='\033[1;33m'
|
|
15
|
+
RED='\033[0;31m'
|
|
16
|
+
NC='\033[0m'
|
|
17
|
+
|
|
18
|
+
# Check if Node.js is installed
|
|
19
|
+
if ! command -v node &> /dev/null; then
|
|
20
|
+
echo -e "${RED}❌ Node.js is not installed${NC}"
|
|
21
|
+
echo "Please install Node.js from https://nodejs.org/"
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo -e "${GREEN}✅ Node.js found: $(node --version)${NC}"
|
|
26
|
+
echo -e "${GREEN}✅ npm found: $(npm --version)${NC}"
|
|
27
|
+
echo ""
|
|
28
|
+
|
|
29
|
+
# Check if devices.conf exists
|
|
30
|
+
if [ ! -f "devices.conf" ]; then
|
|
31
|
+
echo -e "${YELLOW}⚠️ devices.conf not found${NC}"
|
|
32
|
+
echo "Creating example configuration..."
|
|
33
|
+
cat > devices.conf << 'EOF'
|
|
34
|
+
# Device Configuration
|
|
35
|
+
# Format: device_name,udid,ip_address
|
|
36
|
+
# Example:
|
|
37
|
+
# iphone16p,00008140-001C24361E41801C,10.173.221.204
|
|
38
|
+
# ipad,00008132-000A24C022FB801C,10.173.221.66
|
|
39
|
+
EOF
|
|
40
|
+
echo -e "${GREEN}✅ Created devices.conf - please edit with your device details${NC}"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Check if apps_presets.conf exists
|
|
44
|
+
if [ ! -f "apps_presets.conf" ]; then
|
|
45
|
+
echo -e "${YELLOW}⚠️ apps_presets.conf not found${NC}"
|
|
46
|
+
echo "Creating default app presets..."
|
|
47
|
+
cat > apps_presets.conf << 'EOF'
|
|
48
|
+
safari,com.apple.mobilesafari
|
|
49
|
+
settings,com.apple.Preferences
|
|
50
|
+
messages,com.apple.MobileSMS
|
|
51
|
+
camera,com.apple.camera
|
|
52
|
+
photos,com.apple.mobileslideshow
|
|
53
|
+
notes,com.apple.mobilenotes
|
|
54
|
+
mail,com.apple.mobilemail
|
|
55
|
+
EOF
|
|
56
|
+
echo -e "${GREEN}✅ Created apps_presets.conf${NC}"
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
echo ""
|
|
60
|
+
echo "📦 Installing Backend Dependencies..."
|
|
61
|
+
cd webapp/backend
|
|
62
|
+
if [ ! -d "node_modules" ]; then
|
|
63
|
+
npm install
|
|
64
|
+
echo -e "${GREEN}✅ Backend dependencies installed${NC}"
|
|
65
|
+
else
|
|
66
|
+
echo -e "${YELLOW}Backend dependencies already installed${NC}"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Setup .env file
|
|
70
|
+
if [ ! -f ".env" ]; then
|
|
71
|
+
echo ""
|
|
72
|
+
echo "🔑 Setting up environment configuration..."
|
|
73
|
+
cp .env.example .env
|
|
74
|
+
echo -e "${GREEN}✅ Created .env file${NC}"
|
|
75
|
+
echo -e "${YELLOW}⚠️ Please edit webapp/backend/.env and add your OpenAI API key${NC}"
|
|
76
|
+
echo " OpenAI API key is optional but required for AI command conversion"
|
|
77
|
+
echo " Get your key from: https://platform.openai.com/api-keys"
|
|
78
|
+
else
|
|
79
|
+
echo -e "${YELLOW}⚠️ .env already exists${NC}"
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
echo ""
|
|
83
|
+
echo "📦 Installing Frontend Dependencies..."
|
|
84
|
+
cd ../frontend
|
|
85
|
+
if [ ! -d "node_modules" ]; then
|
|
86
|
+
npm install
|
|
87
|
+
echo -e "${GREEN}✅ Frontend dependencies installed${NC}"
|
|
88
|
+
else
|
|
89
|
+
echo -e "${YELLOW}Frontend dependencies already installed${NC}"
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
cd ../..
|
|
93
|
+
|
|
94
|
+
echo ""
|
|
95
|
+
echo "============================================"
|
|
96
|
+
echo -e "${GREEN}✅ Setup Complete!${NC}"
|
|
97
|
+
echo "============================================"
|
|
98
|
+
echo ""
|
|
99
|
+
echo "📋 Next Steps:"
|
|
100
|
+
echo ""
|
|
101
|
+
echo "1. Configure your devices:"
|
|
102
|
+
echo " Edit: devices.conf"
|
|
103
|
+
echo " Format: device_name,udid,ip_address"
|
|
104
|
+
echo ""
|
|
105
|
+
echo "2. (Optional) Add OpenAI API key for AI features:"
|
|
106
|
+
echo " Edit: webapp/backend/.env"
|
|
107
|
+
echo " Add: OPENAI_API_KEY=your_key_here"
|
|
108
|
+
echo ""
|
|
109
|
+
echo "3. Start the backend server:"
|
|
110
|
+
echo " cd webapp/backend"
|
|
111
|
+
echo " npm start"
|
|
112
|
+
echo ""
|
|
113
|
+
echo "4. Start the frontend (in a new terminal):"
|
|
114
|
+
echo " cd webapp/frontend"
|
|
115
|
+
echo " npm start"
|
|
116
|
+
echo ""
|
|
117
|
+
echo "5. Open your browser:"
|
|
118
|
+
echo " http://localhost:3000"
|
|
119
|
+
echo ""
|
|
120
|
+
echo "🎉 Enjoy iOS Device Mind Control!"
|
|
121
|
+
echo ""
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# iOS Device Mind Control - Start Script
|
|
4
|
+
# Starts backend server only (uses production build for frontend)
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
echo "🚀 Starting iOS Device Mind Control"
|
|
9
|
+
echo "===================================="
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
GREEN='\033[0;32m'
|
|
13
|
+
YELLOW='\033[1;33m'
|
|
14
|
+
BLUE='\033[0;34m'
|
|
15
|
+
NC='\033[0m'
|
|
16
|
+
|
|
17
|
+
# Function to cleanup on exit
|
|
18
|
+
cleanup() {
|
|
19
|
+
echo ""
|
|
20
|
+
echo -e "${YELLOW}Stopping servers...${NC}"
|
|
21
|
+
kill $BACKEND_PID 2>/dev/null || true
|
|
22
|
+
exit 0
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
trap cleanup SIGINT SIGTERM
|
|
26
|
+
|
|
27
|
+
# Check if setup was run
|
|
28
|
+
if [ ! -d "webapp/backend/node_modules" ]; then
|
|
29
|
+
echo -e "${YELLOW}⚠️ Backend dependencies not installed. Running setup...${NC}"
|
|
30
|
+
cd webapp/backend && npm install && cd ../..
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Check if frontend build exists
|
|
34
|
+
if [ ! -d "webapp/frontend/build" ]; then
|
|
35
|
+
echo -e "${YELLOW}⚠️ Frontend not built. Building production version...${NC}"
|
|
36
|
+
cd webapp/frontend && npm install && npm run build && cd ../..
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Start backend (serves both API and static frontend)
|
|
40
|
+
echo -e "${BLUE}Starting backend server...${NC}"
|
|
41
|
+
cd webapp/backend
|
|
42
|
+
npm start &
|
|
43
|
+
BACKEND_PID=$!
|
|
44
|
+
echo -e "${GREEN}✅ Backend started (PID: $BACKEND_PID)${NC}"
|
|
45
|
+
echo -e "${GREEN} API: http://localhost:3001${NC}"
|
|
46
|
+
echo -e "${GREEN} Web: http://localhost:3001${NC}"
|
|
47
|
+
|
|
48
|
+
echo ""
|
|
49
|
+
echo "============================================"
|
|
50
|
+
echo -e "${GREEN}✅ Server running!${NC}"
|
|
51
|
+
echo "============================================"
|
|
52
|
+
echo ""
|
|
53
|
+
echo "📱 Open http://localhost:3001 in your browser"
|
|
54
|
+
echo ""
|
|
55
|
+
echo "Press Ctrl+C to stop the server"
|
|
56
|
+
echo ""
|
|
57
|
+
|
|
58
|
+
# Wait for process
|
|
59
|
+
wait
|
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Final Sync Script - Copy all cleaned and updated files to npm-package
|
|
3
|
+
|
|
4
|
+
echo "🔄 Syncing files to npm-package..."
|
|
5
|
+
echo ""
|
|
6
|
+
|
|
7
|
+
SRC_DIR="$(pwd)"
|
|
8
|
+
NPM_DIR="$SRC_DIR/npm-package"
|
|
9
|
+
|
|
10
|
+
# Sync backend files
|
|
11
|
+
echo "📦 Syncing backend files..."
|
|
12
|
+
cp webapp/backend/server.js "$NPM_DIR/lib/"
|
|
13
|
+
cp webapp/backend/executor.js "$NPM_DIR/lib/"
|
|
14
|
+
cp webapp/backend/devices.js "$NPM_DIR/lib/"
|
|
15
|
+
cp webapp/backend/doctor.js "$NPM_DIR/lib/"
|
|
16
|
+
cp webapp/backend/logger.js "$NPM_DIR/lib/"
|
|
17
|
+
cp deviceDetection.js "$NPM_DIR/lib/"
|
|
18
|
+
cp androidDeviceDetection.js "$NPM_DIR/lib/"
|
|
19
|
+
cp webapp/backend/aiProviders.js "$NPM_DIR/lib/"
|
|
20
|
+
echo "✅ Backend files synced"
|
|
21
|
+
|
|
22
|
+
# Sync shell scripts
|
|
23
|
+
echo "📦 Syncing shell scripts..."
|
|
24
|
+
mkdir -p "$NPM_DIR/scripts/shell"
|
|
25
|
+
cp connect_ios_usb_multi_final.sh "$NPM_DIR/scripts/shell/"
|
|
26
|
+
cp connect_ios_wireless_multi_final.sh "$NPM_DIR/scripts/shell/"
|
|
27
|
+
cp connect_android_usb_multi_final.sh "$NPM_DIR/scripts/shell/"
|
|
28
|
+
cp connect_android_wireless_multi_final.sh "$NPM_DIR/scripts/shell/"
|
|
29
|
+
cp android_device_control.sh "$NPM_DIR/scripts/shell/"
|
|
30
|
+
cp ios_device_control.sh "$NPM_DIR/scripts/shell/"
|
|
31
|
+
echo "✅ Shell scripts synced"
|
|
32
|
+
|
|
33
|
+
# Sync config files
|
|
34
|
+
echo "📦 Syncing config files..."
|
|
35
|
+
cp devices.conf "$NPM_DIR/config/"
|
|
36
|
+
cp apps_presets.conf "$NPM_DIR/config/"
|
|
37
|
+
echo "✅ Config files synced"
|
|
38
|
+
|
|
39
|
+
# Sync frontend
|
|
40
|
+
echo "📦 Syncing frontend build..."
|
|
41
|
+
if [ -d "webapp/frontend/build" ]; then
|
|
42
|
+
rm -rf "$NPM_DIR/lib/frontend"
|
|
43
|
+
cp -r webapp/frontend/build "$NPM_DIR/lib/frontend"
|
|
44
|
+
echo "✅ Frontend build synced"
|
|
45
|
+
else
|
|
46
|
+
echo "⚠️ Frontend build not found, skipping..."
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Sync documentation
|
|
50
|
+
echo "📦 Syncing documentation..."
|
|
51
|
+
cp README.md "$NPM_DIR/"
|
|
52
|
+
cp LICENSE "$NPM_DIR/"
|
|
53
|
+
echo "✅ Documentation synced"
|
|
54
|
+
|
|
55
|
+
echo ""
|
|
56
|
+
echo "✅ All files synced to npm-package/"
|
|
57
|
+
echo ""
|
|
58
|
+
echo "📊 Summary:"
|
|
59
|
+
du -sh "$NPM_DIR/lib" "$NPM_DIR/scripts" "$NPM_DIR/config" 2>/dev/null
|
|
60
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
###############################################################################
|
|
4
|
+
# Local Package Testing Script
|
|
5
|
+
# Test the encrypted npm package locally before publishing
|
|
6
|
+
###############################################################################
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
GREEN='\033[0;32m'
|
|
11
|
+
YELLOW='\033[1;33m'
|
|
12
|
+
BLUE='\033[0;34m'
|
|
13
|
+
CYAN='\033[0;36m'
|
|
14
|
+
NC='\033[0m'
|
|
15
|
+
|
|
16
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
+
NPM_PKG_DIR="$SCRIPT_DIR/npm-package"
|
|
18
|
+
DIST_DIR="$NPM_PKG_DIR/dist"
|
|
19
|
+
|
|
20
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
21
|
+
echo -e "${CYAN}🧪 Devicely - Local Package Testing${NC}"
|
|
22
|
+
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
23
|
+
echo ""
|
|
24
|
+
|
|
25
|
+
# Step 1: Build
|
|
26
|
+
echo -e "${BLUE}Step 1: Building package...${NC}"
|
|
27
|
+
cd "$NPM_PKG_DIR"
|
|
28
|
+
npm run build:obfuscated
|
|
29
|
+
echo -e "${GREEN}✅ Build complete${NC}"
|
|
30
|
+
echo ""
|
|
31
|
+
|
|
32
|
+
# Step 2: Check encrypted scripts
|
|
33
|
+
echo -e "${BLUE}Step 2: Verifying encrypted scripts in dist...${NC}"
|
|
34
|
+
cd "$DIST_DIR/scripts/shell"
|
|
35
|
+
SCRIPT_COUNT=$(ls -1 *.sh 2>/dev/null | wc -l | tr -d ' ')
|
|
36
|
+
echo -e "${GREEN}✅ Found $SCRIPT_COUNT encrypted shell scripts${NC}"
|
|
37
|
+
echo ""
|
|
38
|
+
|
|
39
|
+
# Step 3: Show sample encrypted content
|
|
40
|
+
echo -e "${BLUE}Step 3: Sample encrypted script:${NC}"
|
|
41
|
+
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
42
|
+
head -30 android_device_control.sh
|
|
43
|
+
echo -e "${YELLOW}... (encrypted hex content continues)${NC}"
|
|
44
|
+
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
45
|
+
echo ""
|
|
46
|
+
|
|
47
|
+
# Step 4: Verify encryption
|
|
48
|
+
echo -e "${BLUE}Step 4: Verifying encryption format...${NC}"
|
|
49
|
+
if grep -q "const encrypted" android_device_control.sh; then
|
|
50
|
+
echo -e "${GREEN}✅ Scripts are encrypted${NC}"
|
|
51
|
+
else
|
|
52
|
+
echo -e "${RED}❌ Scripts are NOT encrypted!${NC}"
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
echo ""
|
|
56
|
+
|
|
57
|
+
# Step 5: Create and test package
|
|
58
|
+
echo -e "${BLUE}Step 5: Creating npm package...${NC}"
|
|
59
|
+
cd "$DIST_DIR"
|
|
60
|
+
PACKAGE_FILE=$(npm pack 2>&1 | tail -1)
|
|
61
|
+
PACKAGE_SIZE=$(du -h "$PACKAGE_FILE" | cut -f1)
|
|
62
|
+
echo -e "${GREEN}✅ Package: $PACKAGE_FILE (${PACKAGE_SIZE})${NC}"
|
|
63
|
+
echo ""
|
|
64
|
+
|
|
65
|
+
# Step 6: Test installation
|
|
66
|
+
echo -e "${BLUE}Step 6: Testing installation...${NC}"
|
|
67
|
+
TEST_DIR=$(mktemp -d)
|
|
68
|
+
cd "$TEST_DIR"
|
|
69
|
+
npm init -y > /dev/null 2>&1
|
|
70
|
+
npm install "$DIST_DIR/$PACKAGE_FILE" > /dev/null 2>&1
|
|
71
|
+
echo -e "${GREEN}✅ Installation successful${NC}"
|
|
72
|
+
echo ""
|
|
73
|
+
|
|
74
|
+
# Step 7: Test CLI
|
|
75
|
+
echo -e "${BLUE}Step 7: Testing CLI...${NC}"
|
|
76
|
+
VERSION=$(npx devicely --version 2>/dev/null || echo "error")
|
|
77
|
+
if [[ "$VERSION" != "error" ]]; then
|
|
78
|
+
echo -e "${GREEN}✅ CLI works: version $VERSION${NC}"
|
|
79
|
+
else
|
|
80
|
+
echo -e "${RED}❌ CLI failed${NC}"
|
|
81
|
+
fi
|
|
82
|
+
echo ""
|
|
83
|
+
|
|
84
|
+
# Cleanup
|
|
85
|
+
rm -rf "$TEST_DIR"
|
|
86
|
+
rm -f "$DIST_DIR/$PACKAGE_FILE"
|
|
87
|
+
|
|
88
|
+
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
89
|
+
echo -e "${GREEN}🎉 ALL TESTS PASSED!${NC}"
|
|
90
|
+
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
91
|
+
echo ""
|
|
92
|
+
echo -e "${CYAN}Ready to publish:${NC}"
|
|
93
|
+
echo -e " ${YELLOW}./publish-to-npm.sh patch --dry-run${NC} # Test"
|
|
94
|
+
echo -e " ${YELLOW}./publish-to-npm.sh patch${NC} # Publish"
|
|
95
|
+
echo ""
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
###############################################################################
|
|
4
|
+
# Shell Script Protection Verification
|
|
5
|
+
# Checks if shell scripts are properly compiled to binaries
|
|
6
|
+
###############################################################################
|
|
7
|
+
|
|
8
|
+
echo "🔍 Verifying Shell Script Protection..."
|
|
9
|
+
echo ""
|
|
10
|
+
|
|
11
|
+
DIST_SHELL_DIR="npm-package/dist/scripts/shell"
|
|
12
|
+
|
|
13
|
+
if [ ! -d "$DIST_SHELL_DIR" ]; then
|
|
14
|
+
echo "❌ Distribution directory not found: $DIST_SHELL_DIR"
|
|
15
|
+
echo " Run 'npm run build:obfuscated' first"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
echo "📁 Checking: $DIST_SHELL_DIR"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
# Count shell scripts and binaries
|
|
23
|
+
sh_count=$(find "$DIST_SHELL_DIR" -name "*.sh" -type f 2>/dev/null | wc -l | tr -d ' ')
|
|
24
|
+
binary_count=$(find "$DIST_SHELL_DIR" -type f ! -name "*.sh" ! -name "*.c" -perm +111 2>/dev/null | wc -l | tr -d ' ')
|
|
25
|
+
|
|
26
|
+
echo "📊 Protection Status:"
|
|
27
|
+
if [ "$sh_count" -gt 0 ]; then
|
|
28
|
+
echo " ⚠️ Shell scripts (.sh) found: $sh_count (should be 0 for full protection)"
|
|
29
|
+
else
|
|
30
|
+
echo " ✅ No .sh files in distribution (fully protected)"
|
|
31
|
+
fi
|
|
32
|
+
echo " ✅ Binary executables: $binary_count"
|
|
33
|
+
echo ""
|
|
34
|
+
|
|
35
|
+
# List binaries
|
|
36
|
+
echo "🔐 Binary Executables:"
|
|
37
|
+
find "$DIST_SHELL_DIR" -type f ! -name "*.sh" ! -name "*.c" -perm +111 | while read -r file; do
|
|
38
|
+
size=$(du -h "$file" | cut -f1)
|
|
39
|
+
echo " ✅ $(basename "$file") ($size)"
|
|
40
|
+
done
|
|
41
|
+
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
44
|
+
# Verify binaries are not scripts
|
|
45
|
+
echo "🛡️ Verifying binaries are compiled (not scripts)..."
|
|
46
|
+
has_compiled=false
|
|
47
|
+
|
|
48
|
+
find "$DIST_SHELL_DIR" -type f ! -name "*.sh" ! -name "*.c" -perm +111 | while read -r file; do
|
|
49
|
+
if file "$file" | grep -q "executable"; then
|
|
50
|
+
has_compiled=true
|
|
51
|
+
echo " ✅ $(basename "$file"): Compiled binary"
|
|
52
|
+
else
|
|
53
|
+
echo " ⚠️ $(basename "$file"): Not a compiled binary"
|
|
54
|
+
fi
|
|
55
|
+
done
|
|
56
|
+
|
|
57
|
+
echo ""
|
|
58
|
+
echo "✅ Shell Script Protection Verification Complete!"
|
|
59
|
+
echo ""
|
|
60
|
+
if [ "$sh_count" -eq 0 ]; then
|
|
61
|
+
echo "🎉 Full Protection Achieved!"
|
|
62
|
+
echo " ✅ All shell scripts compiled to binaries"
|
|
63
|
+
echo " ✅ No readable .sh files in distribution"
|
|
64
|
+
echo " ✅ Code protected against reverse engineering"
|
|
65
|
+
else
|
|
66
|
+
echo "⚠️ Warning: .sh files still present in distribution"
|
|
67
|
+
echo " Run: cd npm-package && npm run compile:shell"
|
|
68
|
+
fi
|
|
69
|
+
echo ""
|
|
70
|
+
echo "📝 Notes:"
|
|
71
|
+
echo " - Binary executables are much harder to reverse engineer"
|
|
72
|
+
echo " - Original .sh files remain in source (npm-package/scripts/shell/)"
|
|
73
|
+
echo " - Distribution package contains only compiled binaries"
|
|
Binary file
|