Comments (7)
Why do you use root for this? It can be managed via the API, no?
from libsuperuser.
AFAIK sending CTRL-C is not possible.
There are other approaches though:
You can open as many shells as you want.
You can also modify the timeout values.
Also as @AndroidDeveloperLB mentioned there are API methods for taking pictures but this slightly depends on what you are trying to screenshot and API level you are aiming for.
from libsuperuser.
@AndroidDeveloperLB yes, you may record screen at API-level using MediaProjection API. The thing is, it's 5.0 or newer. So I have to use adb screenrecord
to support older version of Android.
from libsuperuser.
@d4rken How do you open a new shell instance? I thought this library is supposed to be used with simple, single static instance like Shell.SU.run(String command)
.
from libsuperuser.
@hendraanggrian I think this way:
final AtomicReference<Shell.Interactive> rootSessionRef = new AtomicReference<>();
rootSessionRef.set(new Shell.Builder().useSU().setWantSTDERR(true).setWatchdogTimeout(5).setMinimalLogging(true).open(//
new Shell.OnCommandResultListener() {
@Override
public void onCommandResult(final int commandCode, final int exitCode, final List<String> output) {
final boolean success = exitCode == Shell.OnCommandResultListener.SHELL_RUNNING;
if (success)
_rootSession = rootSessionRef.get();
}
}));
When you get to "sucess", you can use "_rootSession" .
from libsuperuser.
hi.i want to use 'adb shell screenrecord' command for video capturing with this library.what is the right way for use it?and my device is not root.can i use Shell.SU.run() for running this command?
from libsuperuser.
@FaridBeiranvand For new questions, please create a new thread.
As for the question, if your device isn't rooted, this library cannot be used on it. It requires root.
However, Android already has an official API for screen recording, so you should use it instead of going to root solutions:
http://stackoverflow.com/q/32513379/878126
from libsuperuser.
Related Issues (20)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsuperuser.