Skip to content

Repository files navigation

FTP Client

An Android FTP client with zero external dependencies. Supports command-line upload via adb and a built-in GUI file manager.


English

Overview

  • Adb CLI: Upload files via adb shell am start (bypasses Android 12+ background restrictions)
  • GUI File Manager: Browse, delete, upload, and create folders on remote FTP server
  • Zero Dependencies: Pure socket-based FTP implementation, no third-party libraries
  • Fully Offline Build: All dependencies are cached locally, no network required

Build

./gradlew assembleDebug

APK: app/build/outputs/apk/debug/app-debug.apk

Install

adb install app/build/outputs/apk/debug/app-debug.apk

First Run: Grant Storage Permission

Android 11+ requires the "Manage all files" permission to access /sdcard/.

Run the upload command (see below) → a dialog will pop up → tap "Go to Settings" → enable "Allow management of all files".

Or manually: Settings → Apps → FTP Client → Permissions → Files and media → Allow management of all files.

Usage

Method 1: Helper Script (Windows)

ftp_upload.bat <server_ip><file_path> [port] [username] [password] [remote_path]

Example:

ftp_upload.bat 192.168.3.200 /sdcard/textftp.txt 21 administrator "your_password" /test/textftp.txt

Method 2: Direct adb Command

Windows (must quote the entire command):

adb shell "am start -n com.ftpclient/.FtpProxyActivity --es server_ip 192.168.3.200 --ei server_port 21 --es username administrator --es password your_password --es file_path /sdcard/textftp.txt --es remote_path /test/textftp.txt"

Linux / macOS:

adb shell am start -n com.ftpclient/.FtpProxyActivity --es server_ip "192.168.3.200" --ei server_port 21 --es username "administrator" --es password "your_password" --es file_path "/sdcard/textftp.txt" --es remote_path "/test/textftp.txt"

Method 3: GUI File Manager

Open the app → tap "FTP File Manager" → enter server info → connect.

Features:

  • Browse directories and files
  • Tap folder to enter, navigate back
  • Long press → delete
  • Tap "Upload File" → pick local file → upload to current directory
  • Tap "New Folder" → create a directory

Parameters

ParameterDescriptionRequiredDefault
server_ipFTP server addressYes-
server_portFTP server portNo21
usernameFTP usernameNoanonymous
passwordFTP passwordNoanonymous@
file_pathLocal file pathYes-
remote_pathRemote target pathNofile name (root)

Architecture

ComponentDescription
FtpProxyActivityTransparent proxy activity, starts service then finishes instantly
FtpServiceForeground service, executes FTP upload, shows notification
FtpReceiverBroadcastReceiver (alternative start method)
FtpBrowserActivityGUI file manager (browse, delete, upload)
SimpleFtpClientPure socket FTP client (LIST/DELE/RMD/STOR/CWD/MKD/PWD/CDUP)

Permissions

  • INTERNET — auto granted
  • MANAGE_EXTERNAL_STORAGE — Android 11+, required for /sdcard/ access
  • FOREGROUND_SERVICE_DATA_SYNC — Android 12+, required for foreground service
  • POST_NOTIFICATIONS — Android 13+, required for notification

中文

简介

  • Adb 命令行上传:通过 adb shell am start 启动 FTP 上传(绕过 Android 12+ 后台限制)
  • 图形文件管理器:浏览、删除、上传、新建文件夹
  • 零外部依赖:纯 Socket 实现 FTP 协议,无需第三方库
  • 完全离线编译:所有依赖均已本地缓存,无需网络

编译

./gradlew assembleDebug

APK 路径:app/build/outputs/apk/debug/app-debug.apk

安装

adb install app/build/outputs/apk/debug/app-debug.apk

首次使用:授予文件管理权限

Android 11+ 需要授予「文件管理」权限才能访问 /sdcard/ 目录。

执行上传命令后,设备上会弹出权限申请对话框,选择「去设置」→ 开启「允许管理所有文件」。

或手动设置:系统设置 → 应用管理 → FTP 客户端 → 权限 → 文件和媒体 → 允许管理所有文件。

使用方式

方式一:Helper 脚本(Windows)

ftp_upload.bat <服务器IP><文件路径> [端口] [用户名] [密码] [远程路径]

示例:

ftp_upload.bat 192.168.3.200 /sdcard/textftp.txt 21 administrator "你的密码" /test/textftp.txt

方式二:直接 adb 命令

Windows(必须用引号包住整个命令):

adb shell "am start -n com.ftpclient/.FtpProxyActivity --es server_ip 192.168.3.200 --ei server_port 21 --es username administrator --es password 你的密码 --es file_path /sdcard/textftp.txt --es remote_path /test/textftp.txt"

Linux / macOS:

adb shell am start -n com.ftpclient/.FtpProxyActivity --es server_ip "192.168.3.200" --ei server_port 21 --es username "administrator" --es password "你的密码" --es file_path "/sdcard/textftp.txt" --es remote_path "/test/textftp.txt"

方式三:图形文件管理器

打开 App → 点击「FTP 文件管理器」→ 输入服务器信息 → 连接。

功能:

  • 浏览远程目录和文件
  • 点击文件夹进入,返回上级目录
  • 长按 → 删除
  • 点击「上传文件」→ 选择本地文件 → 上传到当前目录
  • 点击「新建文件夹」→ 创建目录

参数说明

参数说明必填默认值
server_ipFTP 服务器地址-
server_portFTP 服务器端口21
usernameFTP 用户名anonymous
passwordFTP 密码anonymous@
file_path本地文件路径-
remote_path远程目标路径文件名(根目录)

架构

组件说明
FtpProxyActivity透明代理 Activity,启动服务后立即销毁
FtpService前台服务,执行 FTP 上传,通知栏显示状态
FtpReceiver广播接收器(备用启动方式)
FtpBrowserActivity图形文件管理器(浏览、删除、上传)
SimpleFtpClient纯 Socket 实现的 FTP 客户端

所需权限

  • INTERNET — 自动授予
  • MANAGE_EXTERNAL_STORAGE — Android 11+,访问 /sdcard/ 必需
  • FOREGROUND_SERVICE_DATA_SYNC — Android 12+,前台服务必需
  • POST_NOTIFICATIONS — Android 13+,通知必需

About

an android ftp client app

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages