GithubHelp home page GithubHelp logo

mini-webdav-server-for-android's Introduction

Mini WebDAV Server for Android

I originally cloned this from https://github.com/erspicu/Baxermux.server.http, however there was so much to change, fix, enhance, that I finally created a new Android app project, copied code fragments from Baxermux and continued from there.

Why I needed it: in Android 11 and higher the app private directories under

/sdcard/Android/data/package.name.com/files

are so "secure", that noting can access them. When I debug my apps, I often need to manage files there, create new ones, delete etc. On a physical device it's possible to connect with a USB cable and manage the files with host file explorer, however in Android emulators, at least at the time of this writing (Jan. 2021) all I get is "permission denied". No matter if I try to use adb shell, the mediocre "Device File Explorer" in Android Studio, nothing permits file management there. Another issue with the "Device File Explorer" in Android Studio is that it does not show hidden files and directories (with names starting with a dot), which I need to manage too.

Decided to resurrect this WebDAV server and make it a part of my app, at least in the DEBUG mode. Now I can access these folders, using any WebDAV client. On my Windows development host I simply map a network drive to emulator IP address - instructions e.g. here: https://itechbestpractices.com/transfer-files-from-android-to-pc-wireless-without-internet/

It mounts the directory exported by the Mini WebDAV server as a Windows virtual drive, and I can use the native Windows File Explorer, or command prompt, can view and edit the files as if they were local to my computer.

The project contains WdServerLib library module, and a trivial test app. The app pulls the library via the build.gradle command:

debugImplementation project(':WdServerLib')

therefore it does not need any extra permissions when built in RELEASE mode, it pulls WdServerLib only when built in DEBUG mode.

When run on Android 10 and lower with access to the full storage, the files and folders on an additional SD card are read-only. They are read-write on Android 11 due to the new MANAGE_EXTERNAL_STORAGE permission, available in Android 11. On Android 10 and lower managing files there would be possible with scoped storage operations, after the user approves access to directories. Something to consider later.

Adding to existing project from jippack

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency your own app's build gradle:

dependencies {
        debugImplementation 'com.github.gregko:Mini-WebDAV-server-for-Android:v1.6.6'
}

Then make yourself a discrete debug only button or menu item (or as I did - a long press action...) to start the Mini WebDAV Server settings activity:

    Intent intent = new Intent();
    intent.setClassName(MainActivity.this,
                        "com.hyperionics.wdserverlib.ServerSettingsActivity");
    startActivity(intent);

That's all! Hope it will be useful to other developers as well. I don't recommend making a consumer product from this - the security issues would need serious consideration. If you use this project in any way, please send me a note (email or post to Discussions area here, or at least star it) so that I would know it's worth maintaining...

mini-webdav-server-for-android's People

Contributors

gregko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mini-webdav-server-for-android's Issues

It does not work for mac finder on mac 12.4

I am trying to use it for file transmission. But mac finder treats both emulated and application root as files rather than directories. And it seems never try to PROPFIND children of both directories.

Still, thanks for your work.

Unable to write to WebDAV (and copying from restricted to 50 MB files)

So I ran the test application that was included, and I was unable to write to the WebDAV server from Windows Explorer.
First it gives me the option to replace the file in the destination, despite that file never having been put on the phone before.
image
Then if I hit replace, it throws a network error at me, but I can still browse the phone just fine afterwards
image

Reading, renaming, moving, and deleting files all work fine. However, it also seems like I cannot copy files that are larger than 50 MB to my computer. Unsure whenever this is a limitation of the library or app, but supporting files up to 1-5 GB would be a nice improvement.

Device: Galaxy S21
OS: Android 12

does not work works with Sardine library?

I tested your server on android with the Sardine library, it seems that your Profind method does not return a valid response. Have you tested it under these conditions:

sardine.list(http://192.168.86.74:8080)

Error message
Not a valid DAV response

I also tested with several clients on Android and Windows browsers, it was a failure.
An idea?

Thank you so much.

Can you provide QR code function?

After starting the service, a QR code will be displayed, which can be accessed directly by scanning the browser. Google Play has a similar software called http file server, but it needs to select a network interface to start. I think you can still use Google Play after perfecting it. . My usage scenario is that my car downloads files from it.Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.