Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get png file from screencap command #59

Open
geminiwen opened this issue Dec 20, 2016 · 5 comments
Open

Failed to get png file from screencap command #59

geminiwen opened this issue Dec 20, 2016 · 5 comments

Comments

@geminiwen
Copy link

I use adbkit on Android 7.1.1 (Nexus 5X), and call client.screencap() api, when I pipe the stream to fs.createWriteStream("/tmp/a.png").
I got an invalid png format file.
But when I remove "LineTransform" Module in screencap command, it works fine..

So, I don't know if the linetransform should be deprecated ?

@geminiwen
Copy link
Author

The following screencap command works fine on My Device..

class ScreencapCommand extends Command
  execute: ->
    this._send 'shell:screencap -p 2>/dev/null'
    @parser.readAscii 4
      .then (reply) =>
        switch reply
          when Protocol.OKAY
            @parser.raw()
          when Protocol.FAIL
            @parser.readError()
          else
            @parser.unexpected reply, 'OKAY or FAIL'

module.exports = ScreencapCommand

@sorccu
Copy link
Member

sorccu commented Dec 20, 2016

Hmm, interesting. Will have to look into this at some point. If if turns out that they really did remove the encoding, then for backwards compatibility we could probably do something like this._send 'shell:echo && screencap -p 2>/dev/null' and then check the first two bytes and have low overhead automatic detection that way.

@geminiwen
Copy link
Author

geminiwen commented Dec 20, 2016

+1
I'll try this way or wait for your updates :P

@geminiwen
Copy link
Author

Hi, I checked this issue on Mi 4 LTE (Marshmallow 6.0.1), It execute screencap command must be transformed by Linetransform.
And execute 'shell:echo && screencap -p 2>/dev/null' to check 0x0a is an easy way to fix this issue.
But I don't have more android devices, if I should request a pull request ?

@sorccu
Copy link
Member

sorccu commented Dec 21, 2016

Feel free to create a PR, we can tweak it later!

geminiwen added a commit to geminiwen/adbkit that referenced this issue Dec 21, 2016
sorccu added a commit that referenced this issue Mar 29, 2017
…ect that where required. Fixed ##59. Fixes #68. Closes #60.
pimterry pushed a commit to httptoolkit/adbkit that referenced this issue Dec 13, 2021
Signed-off-by: Mingyuan Xia <[email protected]>
Signed-off-by: Mingyuan Xia <[email protected]>
pimterry pushed a commit to httptoolkit/adbkit that referenced this issue Dec 13, 2021
* relint + convert to TS

Signed-off-by: urielch <[email protected]>

* replace some Bluebird buy vanilla Promise

Signed-off-by: urielch <[email protected]>

* use some async

Signed-off-by: urielch <[email protected]>

* rollback

Signed-off-by: urielch <[email protected]>

* update commanderJS

Signed-off-by: urielch <[email protected]>

* update test deps

Signed-off-by: urielch <[email protected]>

* update deps

Signed-off-by: urielch <[email protected]>

* update typing

Signed-off-by: urielch <[email protected]>

* update deps

Signed-off-by: urielch <[email protected]>

* updatedeps

Signed-off-by: urielch <[email protected]>

* prepare update Bluebird version

Signed-off-by: urielch <[email protected]>

* prepare update Bluebird 3

Signed-off-by: urielch <[email protected]>

* fix Buffer usage

Signed-off-by: urielch <[email protected]>

* small patches

Signed-off-by: urielch <[email protected]>

* bluebird 3

Signed-off-by: urielch <[email protected]>

* update generator

Signed-off-by: urielch <[email protected]>

* remove callback + split client

Signed-off-by: urielch <[email protected]>

* clean code

Signed-off-by: urielch <[email protected]>

* clean

Signed-off-by: urielch <[email protected]>

* test are now run as TS

Signed-off-by: urielch <[email protected]>

* add 'client.getPackagesWithFlags' for flags in 'pm list packages' (openstf#56)

Issue: DeviceFarmer#55
Signed-off-by: ov3rk1ll <[email protected]>
Signed-off-by: urielch <[email protected]>

* add flag argument to client.getPackages openstf#56

Signed-off-by: urielch <[email protected]>

* add showcase long-running shell commands (openstf#59)

Signed-off-by: urielch <[email protected]>

* update doc

Signed-off-by: urielch <[email protected]>

* more typing, more docs

Signed-off-by: urielch <[email protected]>

* update doc

Signed-off-by: urielch <[email protected]>

* patch package..json

Signed-off-by: urielch <[email protected]>

* roll back tab size from 4 to 2.

Signed-off-by: urielch <[email protected]>

* update doc

Signed-off-by: urielch <[email protected]>

* fix tesrt unit

Signed-off-by: urielch <[email protected]>

* Extend original `getPackages` method, keep compatibility (openstf#61)

* Extend original `getPackages` method, keep compatibility

Signed-off-by: Sergey Volkov <[email protected]>

* Rename local single character variables

Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: urielch <[email protected]>

* publish project

Signed-off-by: urielch <[email protected]>

* last cleanup

Signed-off-by: urielch <[email protected]>

* resync original package name.

Signed-off-by: urielch <[email protected]>

* Update README.md. Add @DeviceFarmer scope (openstf#50)

Signed-off-by: Sergey Volkov <[email protected]>
Signed-off-by: urielch <[email protected]>

* add 'client.getPackagesWithFlags' for flags in 'pm list packages' (openstf#56)

Issue: DeviceFarmer#55
Signed-off-by: ov3rk1ll <[email protected]>
Signed-off-by: urielch <[email protected]>

* Update README.md

Signed-off-by: urielch <[email protected]>

* fix merge error

Signed-off-by: urielch <[email protected]>

* merge

Signed-off-by: urielch <[email protected]>

* clean merge error

Signed-off-by: urielch <[email protected]>

Co-authored-by: ov3rk1ll <[email protected]>
Co-authored-by: Sergey Volkov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants