Comments (4)
That's really weird. At least give people choice, or put documentation (the old ones still exist), or deprecate it...
I used this library to make things a bit easier, but if the minimal thing is not possible, I think I will make my own solution. It's not the hardest thing to do.
The license is also a weird thing to ask for. It's such a small code...
Anyway, I think I will make my own solution. I just need the root stuff.
from roottools.
I always put credits to all libraries that I use, even in code (so that it will be easier to find) . This is my app:
https://play.google.com/store/apps/details?id=com.lb.app_manager
from roottools.
Another method is to take advantage of Java's threading wait()
and notify()
methods.
public static class RootCommandRunner extends Thread {
@Override
public void run() {
try {
Command command = new Command(0, "root command here") {
@Override
public void commandOutput(int id, String line) {
}
@Override
public void commandCompleted(int id, int exitCode) {
synchronized (RootCommandRunner.this) {
RootCommandRunner.this.notify();
}
}
@Override
public void commandTerminated(int id, String reason) {
synchronized (RootCommandRunner.this) {
RootCommandRunner.this.notify();
}
}
};
RootTools.getShell(true).add(command);
synchronized (this) {
wait();
}
// Anything here will execute after the command is finished
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (RootDeniedException e) {
e.printStackTrace();
}
}
}
from roottools.
@chenxiaolong If you want to use a wait-notifier mechanism , I think this is the correct way to do it:
http://tutorials.jenkov.com/java-concurrency/thread-signaling.html
from roottools.
Related Issues (20)
- Install "Aptoide" HOT 1
- Crash when Shell run HOT 3
- Root tool
- [email protected] HOT 1
- New
- is still alive the project?
- RootTools
- Apple
- __Originally posted by @jackiebrewster307 in https://github.com/IdeasOnCanvas/MNDocumentController/issues/1__
- Apple root HOT 1
- Apple root iPhone HOT 1
- save
- Roottools HOT 1
- How to unlock bootloader and on stylo 6???
- Root HOT 1
- Vivo
- Help me HOT 1
- Almaani0/system/app move HOT 1
- Permission
- I'm using Castify
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 roottools.