Git Product home page Git Product logo

Comments (20)

Stericson avatar Stericson commented on July 29, 2024

Can you show us your code you are using?

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

Ok. I've update the post

from roottools.

Stericson avatar Stericson commented on July 29, 2024

You are missing the super calls.

Add:

super.commandOutput(id, line);

as the last line in your commandOutput method.

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

I can't, eclipse says:

Cannot directly invoke the abstract method commandOutput(int, String) for the type 

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Are you sure you are using 4.0/4.1? commandOutput is not an abstract method anymore.

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

Yes, in roottools .ipr file is there

<project version="4">

it should be the beta version

from roottools.

Stericson avatar Stericson commented on July 29, 2024

I don't think you have version 4. That line doesn't have anything to do with the actual version number.

Additionally, commandOutput is not abstract in version 4.0 or 4.1.

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

I've downloaded the latest version and commandOutput is not abstract. However I still have the same problem also calling super.commandOutput(id, line); at the least line in my commandOutput method.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Ok, let me try and test this myself.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Hmmm, I can't seem to find a "touch_dev" on my device when I do getevent.

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

"touch_dev" there isn't in all devices (it might have an other name) but you can most likely find the event that say when an hardware button is pressed and use it to test. Its name can depend by device and you should try each event. I've the same problem also with that event.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

I think part of the problem is that you are setting the timeout to 0.

I didn't really account for keeping a command running indefinitely....

Let me add this in and I'll give you a new version to test.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Can you try using this version?

Keep in mind you'll need to call cmd.terminate() when you want it to finish.

Once you confirm this is working I'll add in some better support for this use case.

https://drive.google.com/open?id=0B5Amguus3csDZzNMems4Zm5kNU0&authuser=0

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

I tried also with different values it's the same.

from roottools.

andrea993 avatar andrea993 commented on July 29, 2024

Can you give me the source code of the project because if I use the jar I get “Conversion to Dalvik format failed with error 1” when I try to run.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

You may need to clean your project and rebuild it when adding the jar.

I'll check in the changes to the repos, there are changes to both RootShell and RootTools so you'll have to compile both and combine both into a jar or include both in your project.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Also, I added better support for this use case.

When you are done with a command you can either call:

cmd.finish();

OR

cmd.terminate();

One indicates that the command finished as desired and the other indicates that some problem occurred.

All code checked in.

from roottools.

kostaspl avatar kostaspl commented on July 29, 2024

@Stericson
Does .finish() / .terminate() really kill/stop the process executing?
Because it doesn't seem to do that for me (e.g. executing "logcat *:V" with a timeout of 10 sec, callback commandOutput still gets called after timeout with new data).
Btw (not sure if it's relevant) - I'm using my own "su" binary, which just runs a root shell (/system/bin/sh).

from roottools.

zhuoensea avatar zhuoensea commented on July 29, 2024

I use RootTools 4.2, and have the same problem with @andrea993 . It seems that commandOutput can't return until certain number of lines.
So, I run getevent /dev/input/event5 > /storage/sdcard0/input.txt instead, no problem with output, but, I can't stop outputing with finish() or terminate(), just as @kostaspl 's problem. isFinished() returns true, and isExecuting() returns false, but input.txt continues increasing.

So, I'd like to know how did you solve these problem, thank you! @andrea993 @kostaspl @Stericson

from roottools.

kostaspl avatar kostaspl commented on July 29, 2024

@zhuoensea It's been a long time since then, but I think I just used this way:
http://stackoverflow.com/a/10225072

from roottools.

Related Issues (20)

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.