Coder Social home page Coder Social logo

adbfs's Introduction

Instructions

Compilation

You will need at least the following on Debian:

  • android-tools-adb
  • libfuse-dev
  • pkg-config

Install

Put the compiled binary into your <path-to-android-sdk>/tools directory.

Use

$ adbfs <Mountpoint>

adbfs's People

Contributors

chaw avatar code7r avatar ge0rg avatar isieo avatar kstep avatar martin-ueding avatar pashkoff avatar perenecabuto avatar rbmj avatar rzr 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adbfs's Issues

Root support

Would be nice, as an option, to allow mounting the filesystem with root access (i.e. run su before running the actual commands).

"No such file or directory" when attempting to create directory in unwritable directory

vladimir@cybervaio:~/opt/adbfs-rootless$ ./adbfs ~/mnt/droid
--*-- exec_command: adb shell ls

vladimir@cybervaio:~/opt/adbfs-rootless$ cd ~/mnt/droid/etc
vladimir@cybervaio:~/mnt/droid/etc$ ls -al test
ls: cannot access test: No such file or directory
vladimir@cybervaio:~/mnt/droid/etc$ mkdir test
mkdir: cannot create directory ‘test’: No such file or directory

many build problems

Hi!

JFYI

I've got amd64 archlinux with gcc-4.8.2 installed. It doesn't build. It produces zillions errors instead. Just few to mention:

g++ -c -o adbfs.o adbfs.cpp -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse 
adbfs.cpp: In function ‘void clearTmpDir()’:
adbfs.cpp:202:5: error: expected ‘;’ before ‘shell’
     shell(cmd);
     ^
adbfs.cpp:203:25: error: cannot convert ‘const string {aka const std::basic_string<char>}’ to ‘const char*’ for argument ‘1’ to ‘int mkdir(const char*, __mode_t)’
     mkdir(TMP_PATH, 0755);
                         ^
adbfs.cpp: In function ‘int adb_getattr(const char*, stat*)’:
adbfs.cpp:260:36: error: invalid user-defined conversion from ‘const char’ to ‘const key_type& {aka const std::basic_string<char>&}’ [-fpermissive]
     if (true || fileData.find(*path) ==  fileData.end() ||
                                    ^
In file included from /usr/include/c++/4.8.2/string:53:0,
                 from /usr/include/c++/4.8.2/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8.2/bits/ios_base.h:41,
                 from /usr/include/c++/4.8.2/ios:42,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from utils.h:43,
                 from adbfs.cpp:75:
/usr/include/c++/4.8.2/bits/basic_string.tcc:212:5: note: candidate is: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] <near match>
     basic_string<_CharT, _Traits, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/basic_string.tcc:212:5: note:   no known conversion for argument 1 from ‘const char’ to ‘const char*’
adbfs.cpp:260:36: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive]
     if (true || fileData.find(*path) ==  fileData.end() ||
                                    ^
In file included from /usr/include/c++/4.8.2/string:53:0,
                 from /usr/include/c++/4.8.2/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8.2/bits/ios_base.h:41,
                 from /usr/include/c++/4.8.2/ios:42,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
/usr/include/c++/4.8.2/bits/basic_string.tcc:212:5: note: candidate is: std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] <near match>
     basic_string<_CharT, _Traits, _Alloc>::
     ^
/usr/include/c++/4.8.2/bits/basic_string.tcc:212:5: note:   no known conversion for argument 1 from ‘const char’ to ‘const char*’
adbfs.cpp:273:23: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive]
         fileData[*path].timestamp  = time(NULL);
                       ^
In file included from /usr/include/c++/4.8.2/string:53:0,
                 from /usr/include/c++/4.8.2/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8.2/bits/ios_base.h:41,
                 from /usr/include/c++/4.8.2/ios:42,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from utils.h:43,
                 from adbfs.cpp:75:
/usr/include/c++/4.8.2/bits/basic_string.tcc:212:5: error:   initializing argument 1 of ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ [-fpermissive]
     basic_string<_CharT, _Traits, _Alloc>::
     ^
adbfs.cpp:275:27: error: ‘path_string’ was not declared in this scope
         output = fileData[path_string].statOutput;
                           ^
adbfs.cpp: In function ‘int adb_readdir(const char*, void*, fuse_fill_dir_t, off_t, fuse_file_info*)’:

Looking for Maintainer

I have no capacity to maintain this repo anymore, if you like to continue development on adbfs, please let me know here.

Don't fail entire directory if it contains a single unreadable file

In /storage/sdcard1, there is a folder .android_secure which I cannot access via adb. There's also a bunch of perfectly fine directories in there, like Android and Music. However, executing adb shell busybox ls -1a --color\=none "/storage/sdcard1" contains the "Permission denied" error message, and that seems to cause adbfs to just return an I/O error when I do ls storage/sdcard1. Instead, it should be fine with not being able to access some of the directories in there.

are there any options to mount a special device?

one single device adb connected by wifi works fine to mount with adbfs. if there are more than one devices when typing adb devices how to choose the correct one

the adb command itself knows an option -s IP-Number to choose
please what ist the way with adbfs?

thx gina

System:
Kernel: 5.4.0-74-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa

No files listed

This is exactly what I need but...

I installed archlinux aur package http://aur.archlinux.org/packages.php?ID=58996,
which compiles from git with a patch. when I run mkdir /tmp/adbFS && adbfs /tmp/adbFS I get a the following output from ls.
$ ls
ls: cannot access .: No such file or directory
ls: cannot access ..: No such file or directory
ls: cannot access acct: No such file or directory
ls: cannot access cache: No such file or directory
ls: cannot access config: No such file or directory
ls: cannot access d: No such file or directory
ls: cannot access data: No such file or directory
ls: cannot access default.prop: No such file or directory
ls: cannot access dev: No such file or directory
ls: cannot access etc: No such file or directory
ls: cannot access init: No such file or directory
ls: cannot access init.goldfish.rc: No such file or directory
ls: cannot access init.poweroffcharge.rc: No such file or directory
ls: cannot access init.qcom.rc: No such file or directory
ls: cannot access init.qcom.sh: No such file or directory
ls: cannot access init.rc: No such file or directory
ls: cannot access init.zte.rc: No such file or directory
ls: cannot access mnt: No such file or directory
ls: cannot access persist: No such file or directory
ls: cannot access proc: No such file or directory
ls: cannot access res: No such file or directory
ls: cannot access root: No such file or directory
ls: cannot access sbin: No such file or directory
ls: cannot access sdcard: No such file or directory
ls: cannot access sys: No such file or directory
ls: cannot access system: No such file or directory
ls: cannot access ueventd.goldfish.rc: No such file or directory
ls: cannot access ueventd.rc: No such file or directory
ls: cannot access vendor: No such file or directory
?[0;0mdefault.prop?[0m ?[1;34m..?[0m ?[1;34mres?[0m
?[0;0mueventd.goldfish.rc?[0m ?[1;34m.?[0m ?[1;34mroot?[0m
?[0;0mueventd.rc?[0m ?[1;34macct?[0m ?[1;34msbin?[0m
?[1;32minit?[0m ?[1;34mcache?[0m ?[1;34msys?[0m
?[1;32minit.goldfish.rc?[0m ?[1;34mconfig?[0m ?[1;34msystem?[0m
?[1;32minit.poweroffcharge.rc?[0m ?[1;34mdata?[0m ?[1;36md?[0m
?[1;32minit.qcom.rc?[0m ?[1;34mdev?[0m ?[1;36metc?[0m
?[1;32minit.qcom.sh?[0m ?[1;34mmnt?[0m ?[1;36msdcard?[0m
?[1;32minit.rc?[0m ?[1;34mpersist?[0m ?[1;36mvendor?[0m
?[1;32minit.zte.rc?[0m ?[1;34mproc?[0m

Have I missed something?

thanks.
Brian

Vanishing mountpoint on Fedora 21 / Android 4.2.2

I installed adbFS but I am unable to access the phone contents. Mount and umount seem to work but the mountpoint "vanishes":

$ adb shell ls /mnt/sd*
/mnt/sdcard
/mnt/sdcard2

adb is working fine, I can list contents of both SD cards, push/pull no problem. I installed adbFS like this:

$ cd ~/tools
$ git clone https://github.com/isieo/adbFS.git
...
$ cd adbFS
$ make
g++ -c -o adbfs.o adbfs.cpp -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse 
g++ -o adbfs adbfs.o -lfuse -pthread 
$ sudo cp adbfs /usr/local/bin/

Test:

$ mkdir $HOME/phone
$ adbfs $HOME/phone -o modules=subdir -o subdir=/mnt/sdcard/        
--*-- exec_command: rm -rf /tmp/adbfs
$
$ mount | grep phone
adbfs on /home/schimaram/phone type fuse.adbfs (rw,nosuid,nodev,relatime,user_id=1001,group_id=1002)
$
$ ls -la $HOME | grep phone
ls: cannot access /home/schimaram/phone: No such file or directory
d??????????   ? ?         ?                 ?            ? phone
$
$ fusermount -u /home/schimaram/phone                     
$
$ mount | grep phone                 
$

The same happens if I do just adbfs /home/schimaram/phone to mount.

More info:

$ uname -a
Linux b015453-ux 3.18.9-200.fc21.x86_64 #1 SMP Mon Mar 9 15:10:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$
$ rpm -qa \*fuse\* \*android\*
ifuse-1.1.3-5.fc21.x86_64
fuse-sshfs-2.5-1.fc21.x86_64
android-tools-20141219git8393e50-2.fc21.x86_64
fuse-devel-2.9.3-4.fc21.x86_64
fuse-2.9.3-4.fc21.x86_64
fuse-libs-2.9.3-4.fc21.x86_64
$

Git: branch "master" SHA1 b687e00

Input/output error

Hi,
I'm running Lineage OS 7.1.1 and I'm getting this error:

ls: reading directory 'point/': Input/output error

I guess the problem is in on of the methods open/read/releasedir.
I've tried to debug it and in the queue in method readdir there are stored all directories of root. Furthermore, fuse says all methods were successful:

[knezi@holly adbFS]$ ./adbfs point/ -d
--*-- exec_command: rm -rf /tmp/adbfs
FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.26
flags=0x001ffffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000011
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 27938
getattr /
stat -t "/"
--*-- exec_command: adb shell busybox stat -t "/"
   unique: 2, success, outsize: 120
unique: 3, opcode: GETXATTR (22), nodeid: 1, insize: 72, pid: 27938
   unique: 3, error: -38 (Function not implemented), outsize: 16
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 27957
getattr /
stat -t "/"
--*-- exec_command: adb shell busybox stat -t "/"
   unique: 4, success, outsize: 120
unique: 5, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 27957
   unique: 5, success, outsize: 32
unique: 6, opcode: READDIR (28), nodeid: 1, insize: 80, pid: 27957
readdir[0] from 0
--*-- exec_command: adb shell busybox ls -1a --color\=none "/"
   unique: 6, success, outsize: 1520
unique: 7, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0
   unique: 7, success, outsize: 16

I've tried it both adb with root/non-root access. If you need more debugging, tell me what. I'll try to look at it once more later if I figure something out.

And I want to ask if it is really necessary to use busybox? All needed commands are present on my phone. If so, please state it to the dependencies - it took me quite a while to find out.

this does not work for lollipop?

This does not work on lollipop.
When i cd into the mounted dir... the adbfs ends up in 100% cpu utilisation without actually listing the dir.

Implement file deletion

The filesystem does not support file deletion.

By the way, the rest is awesome, keep up the good work! :)

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.