From 3a649efcc875e5cc9893ba38a0a4bb07a32b68b0 Mon Sep 17 00:00:00 2001 From: MR CYBER Date: Sun, 12 Jul 2026 18:33:50 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20initial=20commit=20=E2=80=94=20README,?= =?UTF-8?q?=20community=20files,=20docs,=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 9 ++ .github/FUNDING.yml | 5 + .github/ISSUE_TEMPLATE/bug_report.yml | 74 ++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 31 +++++ .github/PULL_REQUEST_TEMPLATE.md | 23 ++++ CHANGELOG.md | 17 +++ CONTRIBUTING.md | 77 +++++++++++ LICENSE | 21 +++ README.md | 152 +++++++++++++++++++++ docs/adb-commands.md | 104 ++++++++++++++ docs/configuration.md | 59 ++++++++ docs/installation.md | 84 ++++++++++++ docs/root-access.md | 67 +++++++++ docs/troubleshooting.md | 128 +++++++++++++++++ docs/webdav-protocol.md | 100 ++++++++++++++ 15 files changed, 951 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docs/adb-commands.md create mode 100644 docs/configuration.md create mode 100644 docs/installation.md create mode 100644 docs/root-access.md create mode 100644 docs/troubleshooting.md create mode 100644 docs/webdav-protocol.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..962dd86 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,9 @@ +# Default owners for everything in the repo +* @gshellmr-code + +# Builder +builder/ @gshellmr-code + +# Documentation +docs/ @gshellmr-code +*.md @gshellmr-code diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..d0f284f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: [gshellmr-code] +custom: + - https://buymeacoffee.com/mrcyberdev diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..cffb1ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,74 @@ +name: Bug Report +description: Report a bug in WSA WebDev +title: "[Bug]: " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thank you for reporting a bug! + + - type: dropdown + id: component + attributes: + label: Component + options: + - WebDAV Server + - Web File Manager + - ADB Control + - Root Access + - Build System + - Other + validations: + required: true + + - type: input + id: version + attributes: + label: WSA WebDev Version + placeholder: "e.g., 1.0.0" + validations: + required: true + + - type: input + id: environment + attributes: + label: Environment + placeholder: "e.g., WSA on Windows 11, Android 13, x86_64" + validations: + required: true + + - type: textarea + id: description + attributes: + label: Bug Description + validations: + required: true + + - type: textarea + id: steps + attributes: + label: Steps to Reproduce + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected Behavior + validations: + required: true + + - type: textarea + id: logs + attributes: + label: Relevant Logs + render: shell + + - type: checkboxes + id: terms + attributes: + label: Checklist + options: + - label: I have searched existing issues + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..58362d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,31 @@ +name: Feature Request +description: Suggest a new feature for WSA WebDev +title: "[Feature]: " +labels: ["enhancement"] +body: + - type: textarea + id: problem + attributes: + label: Problem Statement + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed Solution + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives Considered + + - type: checkboxes + id: terms + attributes: + label: Checklist + options: + - label: I have searched existing feature requests + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..5846a48 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +## Description + + + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation update +- [ ] Refactoring + +## Testing + +- [ ] Tested on WSA with root +- [ ] Tested on WSA without root +- [ ] WebDAV methods tested +- [ ] Web file manager tested + +## Checklist + +- [ ] Code follows project style +- [ ] Self-review completed +- [ ] Documentation updated diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3a7908c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to WSA WebDev will be documented in this file. + +## [1.0.0] - 2026-07-12 + +### Added +- Initial release +- WebDAV server with full protocol support +- Web file manager SPA (dark/light themes) +- ADB broadcast control (START, STOP, RESTART, STATUS, HEALTH) +- Root filesystem access via Magisk +- User storage access +- Auto-start boot receiver +- Health monitoring (30-second intervals) +- Exponential backoff restart on failure +- Zero external Kotlin dependencies diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..561b44b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,77 @@ +# Contributing to WSA WebDev + +Thank you for your interest in contributing to WSA WebDev! + +## How to Contribute + +### Reporting Bugs + +1. Check [existing issues](https://github.com/WSA-Installer/wsa-webdav/issues) first +2. Open a new issue with: + - Clear title and description + - Steps to reproduce + - Expected vs actual behavior + - Device/environment details + +### Suggesting Features + +1. Open a [feature request](https://github.com/WSA-Installer/wsa-webdav/issues/new?template=feature_request.yml) +2. Describe the problem and proposed solution + +### Pull Requests + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Test on WSA +5. Submit a Pull Request + +## Development Setup + +### Prerequisites + +- JDK 17 +- Python 3 +- Android SDK (auto-installed by build script) +- WSA with ADB access + +### Building + +```bash +# Windows +build.bat + +# Linux/Mac +./build.sh +``` + +The build script will: +1. Check Java installation +2. Download Android SDK if needed +3. Generate Kotlin source files +4. Build the APK + +### Testing + +1. Install the APK: `adb install output/app-release.apk` +2. Start the server: `adb shell am start -n com.wsa.webdav/.MainActivity` +3. Access the web file manager: `http://127.0.0.1:8088` +4. Test WebDAV: `curl -X PROPFIND http://127.0.0.1:8088/files/` + +## Code Style + +### Kotlin + +- Follow Kotlin coding conventions +- Use meaningful variable names +- Add KDoc comments for public APIs + +### Build Script + +- Python 3 compatible +- No external dependencies (stdlib only) +- Use `write_bytes()` for file output + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9ec0135 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 AT Tech Zone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..eab95a0 --- /dev/null +++ b/README.md @@ -0,0 +1,152 @@ +
+ +# WSA WebDev + +### Headless Android WebDAV Server for WSA + +![Version](https://img.shields.io/badge/version-1.0.0-blue?style=for-the-badge) +![Platform](https://img.shields.io/badge/Platform-WSA-3DDC84?style=for-the-badge) +![Language](https://img.shields.io/badge/Language-Kotlin-7F52FF?style=for-the-badge&logo=kotlin&logoColor=white) +![License](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge) + +**Access your WSA file system from any browser — with root support, web file manager, and ADB control.** + +Part of the [WSA Installer](https://github.com/WSA-Installer) organization. + +
+ +--- + +## Overview + +WSA WebDev is a headless Android WebDAV server APK for rooted Windows Subsystem for Android (WSA). It provides: + +- **WebDAV Protocol** — Full WebDAV server with all standard methods +- **Root Access** — Access the entire Android filesystem via Magisk +- **Web File Manager** — Beautiful SPA with dark/light themes +- **ADB Control** — Start, stop, and monitor via ADB broadcasts +- **Auto-Start** — Boot receiver for automatic startup +- **Health Monitoring** — 30-second interval health checks + +## Features + +| Feature | Description | +|:--------|:------------| +| WebDAV Protocol | OPTIONS, GET, PUT, DELETE, MKCOL, COPY, MOVE, PROPFIND, PROPPATCH, LOCK, UNLOCK | +| Root Access | Full filesystem access via `su` (requires Magisk) | +| Web File Manager | Grid/list views, drag-drop, hex viewer, terminal, bookmarks | +| ADB Commands | START, STOP, RESTART, STATUS, HEALTH | +| Auto-Start | Boot receiver for automatic startup | +| Health Monitoring | 30-second interval checks with exponential backoff | +| Zero Dependencies | Pure Kotlin, no external libraries | + +## Quick Start + +### Prerequisites + +- Windows with WSA installed +- Root access (Magisk) — optional, for root mode +- JDK 17 (for building) +- Python 3 (for build script) + +### Build + +```bash +# Windows +build.bat + +# Linux/Mac +chmod +x build.sh +./build.sh +``` + +### Install + +```bash +adb install output/app-release.apk +``` + +### Start Server + +```bash +# User mode +adb shell am start -n com.wsa.webdav/.MainActivity + +# Root mode +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh start" +``` + +### Access Files + +- **WebDAV:** `http://127.0.0.1:8088/files/` +- **Web File Manager:** `http://127.0.0.1:8088` + +## Documentation + +- [Installation Guide](docs/installation.md) +- [Configuration](docs/configuration.md) +- [WebDAV Protocol](docs/webdav-protocol.md) +- [ADB Commands](docs/adb-commands.md) +- [Root Access](docs/root-access.md) +- [Troubleshooting](docs/troubleshooting.md) + +## Architecture + +``` +┌─────────────────────────────────────────────────────┐ +│ WSA WebDev APK │ +├─────────────────────────────────────────────────────┤ +│ │ +│ ┌─────────────┐ ┌──────────────────┐ │ +│ │ WebDAV │ │ Web File Manager │ │ +│ │ Server │◄──►│ (SPA) │ │ +│ │ (Kotlin) │ └──────────────────┘ │ +│ └──────┬──────┘ │ +│ │ │ +│ ▼ │ +│ ┌─────────────┐ ┌──────────────────┐ │ +│ │ Filesystem │ │ Root Manager │ │ +│ │ Provider │ │ (Magisk su) │ │ +│ └─────────────┘ └──────────────────┘ │ +│ │ +│ ┌─────────────┐ ┌──────────────────┐ │ +│ │ ADB │ │ Health Monitor │ │ +│ │ Receiver │ │ (30s interval) │ │ +│ └─────────────┘ └──────────────────┘ │ +│ │ +└─────────────────────────────────────────────────────┘ +``` + +## Tech Stack + +| Technology | Purpose | +|:-----------|:--------| +| Kotlin | Primary language | +| Android SDK 34 | Target platform | +| WebDAV Protocol | File access | +| HTML/CSS/JS | Web file manager SPA | +| ADB | Remote control | + +## Supported Environments + +| Environment | Status | +|:------------|:-------| +| WSA with Magisk (root) | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | +| WSA without root | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | +| Android 13+ | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | +| Android 14+ | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | +| x86_64 | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | +| ARM64 | ![Supported](https://img.shields.io/badge/Supported-3DDC84?style=flat-square) | + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for details. + +## License + +This project is licensed under the MIT License — see [LICENSE](LICENSE) for details. + +## Acknowledgments + +- Part of the [WSA Installer](https://github.com/WSA-Installer) project +- Built by [AT Tech Zone](https://www.youtube.com/@AT_Tech_Zone) diff --git a/docs/adb-commands.md b/docs/adb-commands.md new file mode 100644 index 0000000..8e49133 --- /dev/null +++ b/docs/adb-commands.md @@ -0,0 +1,104 @@ +# ADB Commands + +WSA WebDev can be controlled via ADB broadcasts. + +## Broadcast Actions + +| Action | Description | +|:-------|:------------| +| `com.wsa.webdav.START` | Start the WebDAV server | +| `com.wsa.webdav.STOP` | Stop the WebDAV server | +| `com.wsa.webdav.RESTART` | Restart the WebDAV server | +| `com.wsa.webdav.STATUS` | Get server status | +| `com.wsa.webdav.HEALTH` | Run health check | + +## Usage + +### Start Server + +```bash +adb shell am broadcast -a com.wsa.webdav.START +``` + +### Stop Server + +```bash +adb shell am broadcast -a com.wsa.webdav.STOP +``` + +### Restart Server + +```bash +adb shell am broadcast -a com.wsa.webdav.RESTART +``` + +### Check Status + +```bash +adb shell am broadcast -a com.wsa.webdav.STATUS +# Check result in /sdcard/Android/data/com.wsa.webdav/files/result.json +adb shell cat /sdcard/Android/data/com.wsa.webdav/files/result.json +``` + +### Health Check + +```bash +adb shell am broadcast -a com.wsa.webdav.HEALTH +``` + +## Shell Script Control + +For root users, a shell script provides additional control: + +```bash +# Start +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh start" + +# Stop +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh stop" + +# Restart +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh restart" + +# Status +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh status" + +# Health +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh health" + +# Log +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh log" +``` + +## Automation + +### Start on Boot + +The APK includes a boot receiver that automatically starts the server on device boot. + +### Health Monitoring + +The server performs health checks every 30 seconds. If the server crashes, it will restart with exponential backoff. + +## Troubleshooting + +### Broadcast Not Received + +1. Ensure the APK is installed +2. Check the package name: `com.wsa.webdav` +3. Verify the server is running + +### Status Returns Null + +1. Wait a few seconds after starting +2. Check the log file +3. Restart the server + +### Server Won't Start + +1. Check available ports +2. Verify file permissions +3. Check the Android logcat: + ```bash + adb logcat -s WSAWebDAV + ``` diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 0000000..3d05ad8 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,59 @@ +# Configuration + +WSA WebDev is configured via `config.json`. + +## Default Configuration + +```json +{ + "port": 8088, + "host": "127.0.0.1", + "rootAccess": true, + "anonymousAccess": true, + "maxConnections": 50 +} +``` + +## Configuration Options + +| Option | Type | Default | Description | +|:-------|:-----|:--------|:------------| +| `port` | integer | 8088 | Server port | +| `host` | string | "127.0.0.1" | Server host | +| `rootAccess` | boolean | true | Enable root filesystem access | +| `anonymousAccess` | boolean | true | Allow anonymous access | +| `maxConnections` | integer | 50 | Maximum concurrent connections | + +## Changing Configuration + +### Via Web File Manager + +1. Open the web file manager +2. Navigate to `/data/data/com.wsa.webdav/files/` +3. Edit `config.json` +4. Restart the server + +### Via ADB + +```bash +adb shell "echo '{\"port\": 9090}' > /data/data/com.wsa.webdav/files/config.json" +adb shell am broadcast -a com.wsa.webdav.RESTART +``` + +## Port Configuration + +The default port is 8088. To change it: + +1. Update `config.json` +2. Restart the WebDAV server +3. Update the port forward: + ```bash + adb forward tcp:NEW_PORT tcp:NEW_PORT + ``` + +## Security Considerations + +- The server is designed for local use only +- Do not expose port 8088 to the network without authentication +- Root access provides full filesystem access — use with caution +- Anonymous access allows unauthenticated connections diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..5157800 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,84 @@ +# Installation Guide + +## Prerequisites + +- Windows with WSA installed +- ADB access to WSA +- JDK 17 (for building from source) +- Python 3 (for build script) + +## Build from Source + +### Windows + +```cmd +build.bat +``` + +### Linux/Mac + +```bash +chmod +x build.sh +./build.sh +``` + +### Direct Build + +```bash +python builder/build.py +``` + +The build script will: +1. Check for JDK 17 +2. Download Android SDK if needed +3. Generate Kotlin source files +4. Build the APK using Gradle + +## Install APK + +### Using ADB + +```bash +adb install output/app-release.apk +``` + +### Using WSA Installer + +The WSA WebDev APK is automatically installed by WSA Installer when enabling file sharing. + +## Configure + +Edit `config.json` to customize server settings: + +```json +{ + "port": 8088, + "host": "127.0.0.1", + "rootAccess": true, + "anonymousAccess": true, + "maxConnections": 50 +} +``` + +## Start Server + +### User Mode + +```bash +adb shell am start -n com.wsa.webdav/.MainActivity +``` + +### Root Mode + +```bash +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh start" +``` + +## Access Files + +- **Web File Manager:** http://127.0.0.1:8088 +- **WebDAV URL:** http://127.0.0.1:8088/files/ + +## Mount as Windows Drive + +WSA Installer can automatically mount the WebDAV share as a Windows drive. See the [WSA Installer documentation](https://github.com/WSA-Installer/wsa-installer/blob/main/docs/webdav.md) for details. diff --git a/docs/root-access.md b/docs/root-access.md new file mode 100644 index 0000000..bd553e7 --- /dev/null +++ b/docs/root-access.md @@ -0,0 +1,67 @@ +# Root Access + +WSA WebDev supports root filesystem access via Magisk. + +## Requirements + +- WSA installed +- Magisk installed and configured in WSA +- Root access granted to WSA WebDev + +## Setup + +### 1. Install Magisk in WSA + +Follow the WSA Installer's Play Store installation process, which includes Magisk. + +### 2. Grant Root Access + +1. Open Magisk app in WSA +2. Go to Superuser tab +3. Grant root access to WSA WebDev + +### 3. Enable Root Mode + +Start the server in root mode: + +```bash +adb shell su -c "sh /data/data/com.wsa.webdav/files/app.sh start" +``` + +## Root Filesystem Structure + +When root access is enabled, the following paths are available: + +``` +http://127.0.0.1:8088/ + files/ # User storage (/storage/emulated/0) + root/ # Root filesystem (/) + data/ # App data + system/ # System files + vendor/ # Vendor files +``` + +## Security Considerations + +- Root access provides full filesystem control +- Be careful when modifying system files +- The server runs as root — any vulnerability could compromise the system +- Consider disabling root access if not needed + +## Troubleshooting + +### Permission denied + +1. Ensure Magisk is installed +2. Check Magisk Superuser tab for permissions +3. Try: `adb shell su -c whoami` — should return "root" + +### Root commands fail + +1. Check Magisk version (30.6+ recommended) +2. Reinstall Magisk in WSA +3. Check SELinux mode: `adb shell su -c getenforce` + +### Cannot access /data/data + +This is expected — app data directories have restricted permissions. Use the WebDAV server to access files instead. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 0000000..d99823e --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,128 @@ +# Troubleshooting + +Common issues and solutions for WSA WebDev. + +## Build Issues + +### Java not found + +**Error:** `JAVA_HOME is not set` + +**Solution:** +1. Install JDK 17 +2. Set JAVA_HOME environment variable +3. Or let the build script auto-install via winget/choco + +### Gradle build fails + +**Error:** `Could not resolve dependencies` + +**Solution:** +1. Delete `.build/` directory +2. Run build script again +3. Check internet connection + +### APK not installing + +**Error:** `INSTALL_FAILED_ALREADY_EXISTS` + +**Solution:** +```bash +adb uninstall com.wsa.webdav +adb install output/app-release.apk +``` + +## Server Issues + +### Server won't start + +1. Check if port 8088 is in use: + ```bash + netstat -ano | findstr 8088 + ``` +2. Kill the process using the port +3. Restart the server + +### Connection refused + +1. Ensure WSA is running +2. Check ADB connection: `adb devices` +3. Verify server is running: + ```bash + adb shell pidof com.wsa.webdav + ``` + +### Slow performance + +1. Use USB instead of WiFi for ADB +2. Reduce max connections in config.json +3. Close other network-intensive applications + +## WebDAV Issues + +### Windows cannot connect + +1. Ensure WebClient service is running: + ```cmd + sc start WebDAV + ``` +2. Check BasicAuthLevel in registry: + ``` + HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters + BasicAuthLevel = 2 + ``` +3. Restart WebClient service + +### Files not showing + +1. Check the WebDAV URL path +2. Verify the folder exists in WSA +3. Check server logs + +### Upload fails + +1. Check available storage in WSA +2. Verify file permissions +3. Check max file size limits + +## Root Access Issues + +### Permission denied + +1. Ensure Magisk is installed +2. Grant root access in Magisk Superuser tab +3. Verify: `adb shell su -c whoami` returns "root" + +### SELinux blocking + +1. Check SELinux mode: `adb shell su -c getenforce` +2. Set to permissive (temporarily): `adb shell su -c setenforce 0` + +## Logging + +### View Server Logs + +```bash +adb shell su -c "cat /data/data/com.wsa.webdav/files/server.log" +``` + +### View Android Logcat + +```bash +adb logcat -s WSAWebDAV +``` + +### Health Check + +```bash +adb shell am broadcast -a com.wsa.webdav.HEALTH +adb shell cat /sdcard/Android/data/com.wsa.webdav/files/health.json +``` + +## Getting Help + +If your issue isn't covered: + +1. Check [GitHub Issues](https://github.com/WSA-Installer/wsa-webdav/issues) +2. Open a new [Bug Report](https://github.com/WSA-Installer/wsa-webdav/issues/new?template=bug_report.yml) +3. Include relevant logs and environment details diff --git a/docs/webdav-protocol.md b/docs/webdav-protocol.md new file mode 100644 index 0000000..bd87b9a --- /dev/null +++ b/docs/webdav-protocol.md @@ -0,0 +1,100 @@ +# WebDAV Protocol Reference + +WSA WebDev implements the WebDAV (Web Distributed Authoring and Versioning) protocol. + +## Supported Methods + +| Method | Description | +|:-------|:------------| +| OPTIONS | Get supported methods and features | +| GET | Download a file | +| PUT | Upload a file | +| DELETE | Delete a file or folder | +| MKCOL | Create a folder | +| COPY | Copy a file or folder | +| MOVE | Move/rename a file or folder | +| PROPFIND | Get file/folder properties | +| PROPPATCH | Set file/folder properties | +| LOCK | Lock a file | +| UNLOCK | Unlock a file | + +## WebDAV URL Structure + +``` +http://127.0.0.1:8088/ +├── files/ # User storage (/storage/emulated/0) +│ ├── Download/ +│ ├── DCIM/ +│ └── ... +└── root/ # Root filesystem (root mode only) + ├── data/ + ├── system/ + └── ... +``` + +## Examples + +### List Directory (PROPFIND) + +```bash +curl -X PROPFIND http://127.0.0.1:8088/files/ \ + -H "Depth: 1" +``` + +### Download File (GET) + +```bash +curl http://127.0.0.1:8088/files/Download/document.pdf \ + -o document.pdf +``` + +### Upload File (PUT) + +```bash +curl -X PUT http://127.0.0.1:8088/files/Download/newfile.txt \ + -d "Hello World" +``` + +### Create Folder (MKCOL) + +```bash +curl -X MKCOL http://127.0.0.1:8088/files/Download/NewFolder +``` + +### Delete (DELETE) + +```bash +curl -X DELETE http://127.0.0.1:8088/files/Download/oldfile.txt +``` + +### Copy (COPY) + +```bash +curl -X COPY http://127.0.0.1:8088/files/Download/source.txt \ + -H "Destination: /files/Download/dest.txt" +``` + +### Move (MOVE) + +```bash +curl -X MOVE http://127.0.0.1:8088/files/Download/oldname.txt \ + -H "Destination: /files/Download/newname.txt" +``` + +## Client Compatibility + +The WebDAV server is compatible with: + +- Windows Explorer (WebClient service) +- macOS Finder +- Cyberduck +- WinSCP +- RaiDrive +- Most WebDAV clients + +## Limitations + +- No HTTPS support (local use only) +- No authentication (anonymous access) +- No partial content (Range) requests +- Limited LOCK/UNLOCK implementation