Git Product home page Git Product logo

adbfs's People

Contributors

sebastianhaberey avatar zach-klippenstein 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

adbfs's Issues

"cannot find load_fusefs" on macOS with OSXFUSE 3.10.2

Hi Zach,

I had a look at your code and I really liked the structure of it 👍 So now I am trying to get adbfs working on my Mac, but I'm getting the error above. I take it it's coming from go-fuse (MountRoot function). I wonder if it's an incompatiblity between the old go-fuse version and the up-to-date OSXFUSE. Any ideas?

Install issue on OSX - cannot find package "gopkg.in/alecthomas/kingpin.v2"

Installing on OSX, I received this output when running the go get command:

# github.com/hanwen/go-fuse/fuse/nodefs golang/src/github.com/hanwen/go-fuse/fuse/nodefs/files_darwin.go:5: imported and not used: "time" golang/src/github.com/hanwen/go-fuse/fuse/nodefs/syscall.go:11: undefined: syscall.SYS_UTIMENSAT

Then when running ./install.sh I received:

+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/... internal/cli/adbfs_config.go:3:8: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of: /usr/local/Cellar/go/1.5.2/libexec/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT) /Users/jules/Downloads/golang/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)

/sdcard links to the root directory

After a successful mount, the sdcard directory gets wrongly linked to the root directory, so opening it shows you the root directory again.

Platform-tools - 23.1 rc1
ADB - 1.0.32
SDK Build-tools - 23.0.1

See screenshot below:

screen shot 2015-11-30 at 21 35 19

FileNoExistError

I cannot for the life of me get adbfs to work. I have cloned the repo, done the appropriate go gets / install commands and this is what I am receiving
image

Any help is appreciated :)

Build SHA not set

Hi, I'm trying adbfs, but launching it fails with the following error (same for the adbfs binary):

% ./go.sh run cmd/adbfs/main.go ~/user/mnt
+ go run -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' cmd/adbfs/main.go /home/voidzero/user/mnt
panic: build SHA not set

goroutine 1 [running]:
github.com/zach-klippenstein/adbfs/internal/cli.BuildSHA(0x0, 0x0)
        /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:33 +0x83
github.com/zach-klippenstein/adbfs/internal/cli.versionString(0x93e480, 0x5, 0x0, 0x0)
        /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:50 +0x31
github.com/zach-klippenstein/adbfs/internal/cli.Initialize(0x93e480, 0x5, 0xbe32a0)
        /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/internal/cli/cli.go:25 +0x84
main.main()
        /home/voidzero/user/go/src/github.com/zach-klippenstein/adbfs/cmd/adbfs/main.go:48 +0x4b

goroutine 9 [runnable]:
text/template/parse.lexText(0xc20807d180, 0xa3b040)
        /usr/lib/go/src/text/template/parse/lex.go:228 +0x37b
text/template/parse.(*lexer).run(0xc20807d180)
        /usr/lib/go/src/text/template/parse/lex.go:198 +0x5d
created by text/template/parse.lex
        /usr/lib/go/src/text/template/parse/lex.go:191 +0x1ac

goroutine 8 [syscall]:
os/signal.loop()
        /usr/lib/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
        /usr/lib/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2

mounted dir is empty

What i am doing:

  1. I made adbfs from sources by your instructions.
  2. Then run adbfs and it completed without errors.
$ adbfs --device MTKWWMRMR7S9PNRMNSG --mountpoint ~/mnt/adbfs/
INFO[2017-08-22T16:35:46.405460768+03:00] adbfs v1.0.0                                 
INFO[2017-08-22T16:35:46.405557307+03:00] stat cache ttl: 300ms                        
INFO[2017-08-22T16:35:46.405752685+03:00] connection pool size: 2                      
INFO[2017-08-22T16:35:46.405767761+03:00] device root: /sdcard                         
INFO[2017-08-22T16:35:46.486758309+03:00] server ready.                                
INFO[2017-08-22T16:35:46.486829354+03:00] mounted MTKWWMRMR7S9PNRMNSG on /home/wwarlock/mnt/adbfs
  1. But inside mount point I see nothing except doubled ".."
$ ls -la ~/mnt/adbfs/
total 8
d--------- 0 wwarlock vglusers    0 янв  1  2010 .
d--------- 0 wwarlock vglusers    0 янв  1  2010 .
drwxr-xr-x 6 wwarlock vglusers 4096 авг 22 16:30 ..
drwxr-xr-x 6 wwarlock vglusers 4096 авг 22 16:30 ..

The command adb shell works normally.
I see all files inside (except mounted SDCARD maybe, but I'm not sure am I must see it or not).
Also I can get all files by adb pull.

So, I think there is some error in adbfs.
Please write if I can provide some additional logs.

P.S. Ah, yeah, I almost forgot.
The adbfs-automount utility shows me the strange error. It cannot get device info.

$ adbfs-automount --root ~/mnt/adbfs
INFO[2017-08-22T16:33:20.119775226+03:00] adbfs-automount v1.0.0                       
INFO[2017-08-22T16:33:20.129427638+03:00] using mount root /home/wwarlock/mnt/adbfs    
INFO[2017-08-22T16:33:20.129456387+03:00] mounting as read-only filesystem             
INFO[2017-08-22T16:33:20.129572653+03:00] automounter ready.                           
ERRO[2017-08-22T16:33:20.130549445+03:00] error getting device info for MTKWWMRMR7S9PNRMNSG: ParseError: error performing GetDeviceInfo(ListDevices) on *adb.DeviceClient (DeviceSerial[MTKWWMRMR7S9PNRMNSG]) 
^CINFO[2017-08-22T16:33:21.927559858+03:00] exiting.                                     
INFO[2017-08-22T16:33:21.927625987+03:00] shutting down all mount processes…           
INFO[2017-08-22T16:33:21.927656984+03:00] all processes shutdown.

P.P.S.
My OS is Ubuntu 17.04

Allow specifying the path of device to be mounted

Hi, and thanks for this awesome piece of software! (especially with failures of libmtp)

However, the mounter only mounts the /sdcard on the device. I need to access both internal & external sd cards of my phone. (residing in /storage)
I didn't see any options for specifying that.

Is it supported by any tricks?! (other than rooting the device, of course)

adbfs crashes on boot if device root points to late-mounted device

Repro steps:

  1. Connect a device that is turned off and boot it (or just boot an emulator instance).
  2. As soon as adb shows the device, run adbfs to mount a directory that is not mounted immediately (e.g. on Genymotion emulators, /sdcard is a symlink to a mountpoint that only gets mounted later in the boot process).

Observed behavior: adbfs crashes because it can't find the target.

Incompatible with some versions of adb.

Error looks like:

error getting device info for 00b8dbcb7c4f360c: ParseError: error performing GetDeviceInfo(ListDevices) on *goadb.DeviceClient (DeviceSerial[00b8dbcb7c4f360c])

Include kingpin.v2 in the install process

Setup needs to include:

go get gopkg.in/alecthomas/kingpin.v2

Otherwise you get this error:

$ ./install.sh
+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/...
internal/cli/adbfs_config.go:3:8: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of:
    /usr/local/opt/go/libexec/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT)
    /Users/jalmeida/golang/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)

Support writes from Finder on OSX.

Yea, Finder doesn't seem to think it can write, and some other apps (namely Preview). I've had better luck with things that don't try to do a bunch of fancy metadata/versioning stuff (command line, Sublime Text). I think the Finder problem might have to do with resource forks, but adbfs isn't showing any errors, just that Finder opens and closes the ._* files a bunch and occasionally writes to them.

Cannot install on macOS

I'm not a Go user so I don't know exactly what this error means:

$ go get github.com/zach-klippenstein/adbfs
package github.com/zach-klippenstein/goadb/util: cannot find package "github.com/zach-klippenstein/goadb/util" in any of:
	/usr/local/Cellar/go/1.14.4/libexec/src/github.com/zach-klippenstein/goadb/util (from $GOROOT)
	/Users/agross/go/src/github.com/zach-klippenstein/goadb/util (from $GOPATH)

/Users/agross/go/src/github.com/zach-klippenstein/goadb/util.go exists, but it seems that it is not considered.

$ go version
go version go1.14.4 darwin/amd64

Symbolic links with weired charcaters

When using adbfs on Linux, I get strange symbolic linking behaviour:

$ ls -al /sdcard
/sdcard -> '/home/gqueiroz/mnt/SM_G950F-ce0217129a24c61205/storage/self/primary'$'\n'
$ ls -al /storage/self/primary
/storage/self/primary -> '/mnt/user/0/primary'$'\n'
$ ls -al /mnt/user/0/primary
/mnt/user/0/primary -> '/storage/emulated/0'$'\n'
$ ls -al /storage/emulated/0
[all my files]

Arbitrary Command Injection via runCommand

It looks like the runCommand escaping is quite naive, and will pass along special characters without escaping.

As an example:

cd mount-point
echo Hello > '$(touch /data/local/tmp/hello)'
rm '$(touch /data/local/tmp/hello)'

Should propagate to the ADB protocol command:

shell:"$(touch /data/local/tmp/hello)"

Which allows arbitrary command execution.

Implement writes

I'm successfully mounting emulators on mac, but I can't seem to write to them. I'm attempting to write to the /sdcard dir, and receiving:

jules@Juless-MacBook-Pro ~/mnt/Google_Nexus_5_5_1_0_API_22_1080x1920_updated-192_168_57_101_5555/sdcard $ touch foo.text touch: foo.text: Function not implemented

Is writing unimplemented yet?

Go-fuse dependency throws undefined for syscall.SYS_UTIMENSAT

$ ./install.sh
+ go install -ldflags '-X github.com/zach-klippenstein/adbfs/internal/cli.buildSHA=23ff9c5' -v ./cmd/...
github.com/hanwen/go-fuse/fuse/nodefs
# github.com/hanwen/go-fuse/fuse/nodefs
../../hanwen/go-fuse/fuse/nodefs/files_darwin.go:5: imported and not used: "time"
../../hanwen/go-fuse/fuse/nodefs/syscall.go:11: undefined: syscall.SYS_UTIMENSAT

The unused 'time' import only looks like a warning, but the other seems like an error.

Update installation method to NOT require 'go get'

While following the instruction, I get this.

(base)  ~/Desktop/ go get github.com/zach-klippenstein/adbfs
go: go.mod file not found in current directory or any parent directory.
	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.

Instruction should be fixed. 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.