Giter VIP home page Giter VIP logo

roottools's People

Contributors

stericson avatar chainsdd avatar thuantran avatar

Watchers

James Cloos avatar

roottools's Issues

Remount fails to mount directory

What steps will reproduce the problem?
if(RootTools.isRootAvailable()) {
    String appsDirPath = "/data/app";
    File appsDir = new File(appsDirPath);
    boolean result = RootTools.remount(appsDirPath, "rw");
    if(result) {
        appsDir.list();
    }
}

What is the expected output? What do you see instead?
.list() should allow me to see all files contained within the directory, 
however it returns null. Further inspection indicates that appsDir.canRead() 
returns a false.

What version of the product are you using? On what operating system?
RootTools 1.7, Android 4.0.4

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 2 May 2012 at 8:03

Improve error management: Executer.sendShell, Result and error output

First of all, thank you very much from the great work you are doing with this 
very useful roottools library :)

I saw that you implement an error management using errorStream in 
Executer.sendShell. That's great thing that was missing but the problem is that 
standard and error output are mixed which makes them difficult to manage.

I'd suggest to update the Result object by adding a "processError" that will be 
called by Executer.sendShell for errors:
-> process for standard output (inputStream)
-> processError for errors (errorStream)
That would makes it much easyer to use!

Original issue reported on code.google.com by [email protected] on 14 Nov 2011 at 5:56

Block Until Command has been processed

Hello,

since the latest version the waitFor has been removed. Now i try to implement 
it on my own and let the script run until it has been done.

This is how i do it (currently) but it doesnt looks like this is the way how it 
should be.

Command command = new Command(0, "chmod 777 /sdcard/test") {
        @Override
        public void commandOutput(int id, String line) {
        }

        @Override
        public void commandTerminated(int id, String reason) {
        }

        @Override
        public void commandCompleted(int id, int exitCode) {
            Log.d(TAG, "Command completed");
        }
    };

    RootTools.getShell(true);
    Shell.runRootCommand(command);
    while (!command.isFinished()) {
        Thread.sleep(1);
    }
    Log.d(TAG, "now the command is finished");


Im using the rootools in intentservices/asynctask. Blocking is not a problem 
but its important in my case. Any idea how to use it?

Original issue reported on code.google.com by [email protected] on 25 Sep 2013 at 11:04

Android 4.3 Remount issue and a small logic error

Just a small logic error in 
http://code.google.com/p/roottools/source/browse/trunk/Developmental/RootTools_s
dk3_generic/src/com/stericson/RootTools/internal/RootToolsInternalMethods.java

I think line 1214 should be:
if (!line.contains("no such tool")) {
and not:
if (line.contains("no such tool")) {
as it currently is

Also as the summary said, it seems like remount method does not work on Android 
4.3.

I'm using RootTools 3.1beta with Nexus 7 4.3 BTW.

Original issue reported on code.google.com by [email protected] on 31 Jul 2013 at 2:54

Read response char per char

Hi,

I want to use a program in the shell which generates percentage advancement.
For that the shell program use the char(8) which corresponds to Backspace.

I also want to refresh a view in the application each time the percentage is 
refreshed.

For now, I use that:
 Process localProcess = Runtime.getRuntime().exec(theCommandToExecute);
            BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localProcess.getInputStream()));

 while ((mCharToCheck = (char) localBufferedReader.read()) != -1 && !isCancelled) {
                // out of Unicode
                if (mCharToCheck == 65535) {
                    mCommandResult.append("\nEND OF EXECUTION");
                    break;
                }
                //Backspace
                if (mCharToCheck == 8) {
                    mCommandResult.setLength(mCommandResult.length() - 1);
                } else {
                    mCommandResult.append((char) mCharToCheck);
                    publishProgress(CODE_UPDATE_AVAILABLE, mCommandResult.toString());
                }
            }

I am sure your library is more stable that my little code, but unfortunately I 
notice that the listener Result is refreshed line per line (as per the source 
code of the Class Worker).

Is there a way to get the result character per character?

Original issue reported on code.google.com by [email protected] on 8 Nov 2012 at 10:06

copyfile maintain permissions


What version of the product are you using? On what operating system?
1.6.1 dev branch compiled 3/8/12
Please provide any additional information below.
in the copy file method you should use the -p flag to maintain the permissions 
or at least have an overridden method with the option to.

as simple fix that saves time so the developer doesnt have to keep track of 
their own permissions 

anyway love this saved me so much time great work 

Original issue reported on code.google.com by [email protected] on 9 Mar 2012 at 10:24

Makes the app fc?

I am trying to use this, but it wont work. Do I have to do something other than 
just add the jar via referenced libraries?

Original issue reported on code.google.com by [email protected] on 4 Apr 2012 at 9:28

Improve copyFile method and add deleteFile method

Hi there,

Trickster MOD developer here. It's been great using RootTools but it would be 
greater if you have a new copyFile method that has the following parameters:
copyFile(source, destination, remountAsRw, newPermissions)

And a deleteFile method like so
deleteFile(target, remountAsRw)

What version of the product are you using?
RootTools 2.4

Original issue reported on code.google.com by [email protected] on 15 Sep 2012 at 11:14

Running multiple commands

What steps will reproduce the problem?
1. Wiki "Running root commands" example
2. I try to run multiple commands as
String[] commands = new String[] { command1, command2 };
List<String> otherOutput = RootTools.sendShell(commands);

What is the expected output? What do you see instead?
I'd like to see a cool root command sequence.
I don't see anything. Eclipse get pissed off and shows: The method 
sendShell(String) in the type RootTools is not applicable for the arguments 
(String[])

What version of the product are you using? On what operating system?
RootTools-0.9.1-sdk3-generic
Ubuntu
Eclipse SDK Version: 3.5.2
Android Development Toolkit Version: 10.0.1.v201103111512-110841

I used a naive workaroud:
List<String> otherOutput = RootTools.sendShell(commands, 0);

Original issue reported on code.google.com by [email protected] on 5 May 2011 at 8:56

isAccessGiven() timeout

What?

Trying to verify that access was given;
I have a TextView and a button.
When the button is pressed I'm using isAccessGiven() to check for root.

---
        this.btnCheckRoot = (Button) findViewById(R.id.btnGetInfo);
        this.btnCheckRoot.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {

                if(RootTools.isAccessGiven()) {
                    tv1.setText("oh yeah");
                } else {
                    tv1.setText("no root yet");
                }
            }
        });

---

LogCat:

12-07 17:21:40.614: W/System.err(2974): java.util.concurrent.TimeoutException: 
Broken pipe
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.<init>(Shell.java:71)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.startRootShell(Shell.java:107)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.InternalMethods.isAccessGiven(InternalMethods.java:771)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.RootTools.isAccessGiven(RootTools.java:530)
12-07 17:21:40.614: W/System.err(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:70)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.614: W/System.err(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.614: W/System.err(2974):     at 
dalvik.system.NativeStart.main(Native Method)
12-07 17:21:40.614: D/AndroidRuntime(2974): Shutting down VM
12-07 17:21:40.614: W/dalvikvm(2974): threadid=1: thread exiting with uncaught 
exception (group=0x40015560)
12-07 17:21:40.624: E/AndroidRuntime(2974): FATAL EXCEPTION: main
12-07 17:21:40.624: E/AndroidRuntime(2974): java.lang.NullPointerException
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:73)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
dalvik.system.NativeStart.main(Native Method)

---

The weird thing, is that whenever I remove the
else {tv1.setText("no root yet");}

the error goes away. Error occures when pressing the button.

Original issue reported on code.google.com by [email protected] on 7 Dec 2012 at 4:26

getShell() timeout in broadcast receiver trigger by AlarmManager when phone is sleeping.

What steps will reproduce the problem?
1. Set up a pending intent in AlarmManager with XXX_WAKEUP flag in 10 seconds.
2. Let the phone sleep. (screen off)
3. Call getShell() in broadcast receiver trigger by pending intent, it throws 
TimeoutException:

02-17 01:00:52.628: W/Cleaner(4137): java.util.concurrent.TimeoutException: 
RootAccess denied?.
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:73)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:295)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:443)
02-17 01:00:52.628: W/Cleaner(4137):    at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:465)


What is the expected output? What do you see instead?
getShell() should succeed as that when phone is not sleeping.

What version of the product are you using? On what operating system?
2.6

Please provide any additional information below.
This issue is not appearing if SuperSU is installed instead of SuperUser.

Original issue reported on code.google.com by oasisfeng on 16 Feb 2013 at 5:10

isRootAvailable uses SU access while it should not?

What steps will reproduce the problem?
1. call "RootTools.isRootAvailable()
2. SuperUser apk asks for SU permission
3.

What is the expected output? What do you see instead?
It should only show if root is available, however it somehow triggers root 
access.

What version of the product are you using? On what operating system?
2.6

Please provide any additional information below.

According to the docs it should not try to use root when that action is 
performed, but it does somehow.

Original issue reported on code.google.com by [email protected] on 8 Apr 2013 at 7:58

in android ice have error

in android ice when i use roottools, it's have proplem, below is logs.

08-15 10:46:44.824: D/RootTools v2.2(11007): Checking for su
08-15 10:46:44.824: D/RootTools v2.2(11007): Starting Shell!
08-15 10:46:44.824: D/RootTools v2.2(11007): Starting shell: /system/bin/sh
08-15 10:46:44.863: D/RootTools v2.2(11007): Sending command(s): ls 
/data/local/tmp
08-15 10:46:44.871: D/RootTools v2.2(11007): opendir failed, Permission denied
08-15 10:46:44.871: D/RootTools v2.2(11007): Command 0finished.
08-15 10:46:44.871: D/RootTools v2.2(11007): Starting Root Shell!
08-15 10:46:44.871: D/RootTools v2.2(11007): Starting shell: su
08-15 10:46:44.933: D/RootTools v2.2(11007): Starting Root Shell!
08-15 10:46:44.933: D/RootTools v2.2(11007): Starting shell: su
08-15 10:46:44.965: D/RootTools v2.2(11007): Error: Unable to start shell, 
unexpected output "Permission denied"



Original issue reported on code.google.com by [email protected] on 15 Aug 2012 at 2:55

isAccessGiven() timeout

What?

Trying to verify that access was given;
I have a TextView and a button.
When the button is pressed I'm using isAccessGiven() to check for root.

---
        this.btnCheckRoot = (Button) findViewById(R.id.btnGetInfo);
        this.btnCheckRoot.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {

                if(RootTools.isAccessGiven()) {
                    tv1.setText("oh yeah");
                } else {
                    tv1.setText("no root yet");
                }
            }
        });

---

LogCat:

12-07 17:21:40.614: W/System.err(2974): java.util.concurrent.TimeoutException: 
Broken pipe
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.<init>(Shell.java:71)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.startRootShell(Shell.java:107)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.InternalMethods.isAccessGiven(InternalMethods.java:771)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.RootTools.isAccessGiven(RootTools.java:530)
12-07 17:21:40.614: W/System.err(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:70)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.614: W/System.err(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.614: W/System.err(2974):     at 
dalvik.system.NativeStart.main(Native Method)
12-07 17:21:40.614: D/AndroidRuntime(2974): Shutting down VM
12-07 17:21:40.614: W/dalvikvm(2974): threadid=1: thread exiting with uncaught 
exception (group=0x40015560)
12-07 17:21:40.624: E/AndroidRuntime(2974): FATAL EXCEPTION: main
12-07 17:21:40.624: E/AndroidRuntime(2974): java.lang.NullPointerException
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:73)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
dalvik.system.NativeStart.main(Native Method)

---

The weird thing, is that whenever I remove the
else {tv1.setText("no root yet");}

the error goes away. Error occures when pressing the button.

Original issue reported on code.google.com by [email protected] on 7 Dec 2012 at 4:26

isAccessGiven() throwing error for customized ROM


Hi ,
I am trying to use isAccessGiven() method on cynogenmod flashed ROM environment 
. I am getting the following error .. 



03-17 02:06:56.377: E/Database(617): Error inserting package=com.inauth.root 
uid=10060 exec_uid=0 allow=1 exec_cmd=/system/bin/sh name=Rootchecker
03-17 02:06:56.377: E/Database(617): 
android.database.sqlite.SQLiteConstraintException: error code 19: constraint 
failed
03-17 02:06:56.377: E/Database(617):    at 
android.database.sqlite.SQLiteStatement.native_execute(Native Method)
03-17 02:06:56.377: E/Database(617):    at 
android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:61)
03-17 02:06:56.377: E/Database(617):    at 
android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:
1582)
03-17 02:06:56.377: E/Database(617):    at 
android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1426)
03-17 02:06:56.377: E/Database(617):    at 
com.noshufou.android.su.provider.PermissionsProvider.insert(PermissionsProvider.
java:309)
03-17 02:06:56.377: E/Database(617):    at 
android.content.ContentProvider$Transport.insert(ContentProvider.java:198)
03-17 02:06:56.377: E/Database(617):    at 
android.content.ContentResolver.insert(ContentResolver.java:613)
03-17 02:06:56.377: E/Database(617):    at 
com.noshufou.android.su.SuRequestActivity.sendResult(SuRequestActivity.java:232)
03-17 02:06:56.377: E/Database(617):    at 
com.noshufou.android.su.SuRequestActivity.onClick(SuRequestActivity.java:204)
03-17 02:06:56.377: E/Database(617):    at 
android.view.View.performClick(View.java:2501)
03-17 02:06:56.377: E/Database(617):    at 
android.view.View$PerformClick.run(View.java:9107)
03-17 02:06:56.377: E/Database(617):    at 
android.os.Handler.handleCallback(Handler.java:587)
03-17 02:06:56.377: E/Database(617):    at 
android.os.Handler.dispatchMessage(Handler.java:92)
03-17 02:06:56.377: E/Database(617):    at android.os.Looper.loop(Looper.java:130)
03-17 02:06:56.377: E/Database(617):    at 
android.app.ActivityThread.main(ActivityThread.java:3835)
03-17 02:06:56.377: E/Database(617):    at 
java.lang.reflect.Method.invokeNative(Native Method)
03-17 02:06:56.377: E/Database(617):    at 
java.lang.reflect.Method.invoke(Method.java:507)
03-17 02:06:56.377: E/Database(617):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
03-17 02:06:56.377: E/Database(617):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
03-17 02:06:56.377: E/Database(617):    at dalvik.system.NativeStart.main(Native 
Method)

Original issue reported on code.google.com by [email protected] on 17 Mar 2012 at 9:15

Make deleteFileOrDirectory() a static method

An app can call most RootTools APIs without creating a new object:

        gotShell = RootTools.checkUtil("dmesg");
        RootTools.copyFile("/data/local/tmp/abc", "/system/abc", true, false);
        RootTools.remount("/system", "RW");
        ...

But for deleteFileOrDirectory() it needs to do:

        new RootTools().deleteFileOrDirectory("/data/foo", false);

It would be nice if this call was more consistent with the others:

        RootTools.deleteFileOrDirectory("/data/foo", false);

Trivial patch attached.

Original issue reported on code.google.com by [email protected] on 9 Jul 2013 at 12:21

Attachments:

InternalMethod getBusyBoxApplets(String path) bug

Because of a fail logic here if we call
RootTools.getBusyBoxApplets()
It will be the same as calling RootTools.getBusyBoxApplets("/") which is wrong.

To fix it simply do this for InternalMethod.getBusyBoxApplets(String path)
static List<String> getBusyBoxApplets(String path) throws Exception {
 if (path != null && !path.endsWith("/") && !path.isEmpty()) {
  path += "/";
 }

"&& !path.isEmpty()" is what missing.

Original issue reported on code.google.com by [email protected] on 27 Dec 2012 at 12:25

Streams are not closed which leads to "too many open files errors"

What steps will reproduce the problem?
1. Create a small app, which loops over a shell command for several times
2. After some iterations the programm will abort with a "Too many open files" 
exception

The main point is, that each Process has 3 streams associated with it (input, 
output and error). All three streams need to be closed individually. As far as 
I can see the currently committed code 
(https://code.google.com/p/roottools/source/browse/trunk/Developmental/RootTools
_sdk3_generic/src/com/stericson/RootTools/execution/Shell.java) the streams are 
not closed.

proc.destroy() may not close all the streams. It says so in the documentation, 
but here someone says it is OS dependend: 
http://stackoverflow.com/questions/15956452/troubleshooting-too-many-files-open-
with-lsof (second comment on first answer)

See also 
http://mark.koli.ch/2011/01/leaky-pipes-remember-to-close-your-streams-when-usin
g-javas-runtimegetruntimeexec.html for reference (although I would not use 
IOUtils just for that).

I am using v3-beta, release on June 30th. Please provide an updated JAR, when 
the issue is fixed.

Original issue reported on code.google.com by [email protected] on 4 Jul 2013 at 8:34

installBinary() - feature requests

Currently RootTools.installBinary() extracts a raw resource into 
/data/data/app.package/files/<foo>, optionally setting the permissions for a 
new file.  This is a useful library function, and I was wondering if it could 
be extended to cover some other common patterns:


1) If the destination file already exists, compare the checksum or content to 
the resource data, and if it matches, just skip it (assuming the permissions 
are correct).  This avoids unnecessary writes to the flash and risk of 
corrupting a good binary.

Here are a few examples of projects which could benefit from having a common 
library function perform the comparison:

https://github.com/pragma-/networklog/blob/master/src/com/googlecode/networklog/
SysUtils.java#L34

https://github.com/ukanth/afwall/blob/beta/src/dev/ukanth/ufirewall/Api.java#L13
06

https://github.com/project-voodoo/gstreamer-android-app/blob/0a11086950962e8f191
0e4e8acf882cb34b2f165/src/org/projectvoodoo/gstandroid/utils/Utils.java#L26

https://github.com/blacksmithlabs/NetworkRecorder/blob/4f5fb20cd33eb7f1ce58e2a52
e0b43c4fafd27c8/Network%20Recorder/src/main/java/com/blacksmithlabs/networkrecor
der/helpers/SysUtils.java#L42


2) If the destination file already exists and is out of date, delete it first.  
Trying to overwrite a binary that is currently executing will result in a "text 
file busy" error from the OS.  Deleting it then opening a new file creates a 
new inode, avoiding the problem.

One situation in which this may be preferable to just calling killProcess() is 
if a system process or another app could be running a binary with the same 
name.  e.g. if an app wants to update /system/bin/sh it probably will not want 
to kill all currently executing "sh" instances.


3) In many cases, an app will want to copy a raw binary resource into a file 
under /system instead of /data/data/app.package/files/.  This could include 
startup scripts under /system/etc/init.d, system utilities like busybox under 
/system/xbin, {cifs,tun}.ko under /system/lib/modules, etc.

Would it be possible to extend installBinary() so that if an absolute path is 
provided, it writes the resource data to a root-owned binary under /system 
similar to copyFile(), all in one easy step?  (Ideally this would include the 
logic from #1 and #2 above.)

Examples of apps having to "roll their own" implementation of this 
functionality:

https://github.com/carlson5/CQuest/blob/184af2fc39610808facacb74a67ebc1d3e2f4abf
/CS598rhk/src/edu/illinois/CS598rhk/MainActivity.java

https://github.com/j0b0sapi3n/cs188-caradhoc/blob/99250c38cd63cbf2c214c7b0518022
a8ebfcb951/src/edu/ncsu/AdhocClient/AdhocClient.java#L147


I can help write the code if desired.

Thanks.

Original issue reported on code.google.com by [email protected] on 8 Sep 2013 at 6:56

RootTools.isRootAvailable() exception

What steps will reproduce the problem?
The problem is very hard to reproduce. It happens randomly on several different 
devices.

What is the expected output? What do you see instead?
I'm simply looking t get the results from isRootAvailable but instead my app 
freeze and crash when I get this exception.

What version of the product are you using? On what operating system?
I'm using RootTools version 2.5.0. I saw this issue happen on all sort of OS, 
2.3, 4.0, 4.2. All OS I had this issue were NOT rooted.

Please provide any additional information below.
I know this is coming from RootTools.isRootAvailable() because it is the only 
command I'm using from RootTools

Here is the exception I get
01-01 01:22:51.964: I/System(9632): libcore.io.ErrnoException: kill failed: 
ESRCH (No such process)
01-01 01:22:51.964: I/System(9632):     at libcore.io.Posix.kill(Native Method)
01-01 01:22:51.964: I/System(9632):     at 
libcore.io.ForwardingOs.kill(ForwardingOs.java:77)
01-01 01:22:51.964: I/System(9632):     at 
java.lang.ProcessManager$ProcessImpl.destroy(ProcessManager.java:257)
01-01 01:22:51.964: I/System(9632):     at 
com.stericson.RootTools.execution.Shell$3.run(Shell.java:433)
01-01 01:22:51.964: I/System(9632):     at java.lang.Thread.run(Thread.java:856)

When this crash happens all sort of stuff start to go wrong in the phone and I 
need to reboot it in order to get the phone working properly again.

Original issue reported on code.google.com by [email protected] on 19 Sep 2013 at 5:08

ANR on isRootAvailable() reported by Google Play

What steps will reproduce the problem?
I cannot reproduce it, but the Google Play dev console reports this ANR

DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x40c57460 self=0x1108868
| sysTid=22803 nice=0 sched=0/0 cgrp=default handle=1074107656
| schedstat=( 191488521 62758911 315 ) utm=12 stm=7 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x41ad6ac8> (a java.lang.VMThread) held by tid=17 (Thread-4752)
at java.lang.Thread.join(Thread.java:822)
at java.lang.Thread.join(Thread.java:778)
at com.stericson.RootTools.execution.Shell.<init>(Shell.java:68)
at com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
at com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:291)
at 
com.stericson.RootTools.internal.RootToolsInternalMethods.returnPath(RootToolsIn
ternalMethods.java:82)
at 
com.stericson.RootTools.internal.RootToolsInternalMethods.getPath(RootToolsInter
nalMethods.java:1045)
at com.stericson.RootTools.RootTools.getPath(RootTools.java:419)
at 
com.stericson.RootTools.internal.RootToolsInternalMethods.findBinary(RootToolsIn
ternalMethods.java:604)
at com.stericson.RootTools.RootTools.findBinary(RootTools.java:269)
at com.stericson.RootTools.RootTools.isRootAvailable(RootTools.java:668)
at 
com.benhirashima.unlockwithwifi.common.DeviceAdminIntro.showMessage(DeviceAdminI
ntro.java:97)
at 
com.benhirashima.unlockwithwifi.common.DeviceAdminIntro.onResume(DeviceAdminIntr
o.java:64)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1158)
at android.app.Activity.performResume(Activity.java:4607)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2448)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2486)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2000)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
at dalvik.system.NativeStart.main(Native Method)

What is the expected output? What do you see instead?
NA

What version of the product are you using? On what operating system?
Using version 2.6. OS version not given by Google Play.

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 14 Jun 2013 at 4:45

Expose return value of Runtime Process

I don't see any way to get the return value (what would show up in the shell as 
$?) from the command that was run via Process. Could you find some way to get 
the last return value and expose it to the caller?

Original issue reported on code.google.com by [email protected] on 5 Jul 2011 at 4:07

remount command not compatible with android 4.3?

I have an application that needs to remount /system in RW.
It used to work well but since I upgraded to android 4.3, the remount command 
doesn't work anymore.

What steps will reproduce the problem?
1. boolean status = RootTools.remount("/system", "RW");

What is the expected output? What do you see instead?
It used to return true as expected. It now returns false.

What version of the product are you using? On what operating system?
I was using Roottools 1.7. I moved to version 2.6 but the problem still persist.
The problem started showing up in Android 4.3

Original issue reported on code.google.com by [email protected] on 29 Jul 2013 at 4:35

getMountedAs() returns wrong resulst

What steps will reproduce the problem?
1. $ adb shell mount | grep /system -> ... /system ext4 rw...
2. RootTools.getMountedAs("/system") -> ro

reason:
"/system" contains (as you implemented it) "/" and as well "/sys" (both ro)

as I don't know how to contribute at googlecode (i don't think its even 
possible?!) :) I attach my fix/solution/workaround/whatever here, in hopes it 
helps somebody
worked for the cases I tested so far...

Original issue reported on code.google.com by [email protected] on 16 Aug 2013 at 4:10

Attachments:

File resource is not released

calling 
RootTools.isRootAvailable()
gets to 
internal.RootToolsInternalMethods.getMounts()
which has a line at #981 (in v2.6)

lnr = new LineNumberReader(new FileReader("/proc/mounts"));

that FileReader is never closed, please do so ;)

Original issue reported on code.google.com by [email protected] on 19 Jun 2013 at 10:44

Commands with special characters fails

run:
RootTools.sendShell("ls -l /sdcard/äüß", 0, result, 10000);

Result.processError(String) called with 
"/sdcard/???: No such file or directory"

A quick look at the sources of Shell.java showed me the possible reason:
https://code.google.com/p/roottools/source/browse/trunk/Developmental/RootTools_
sdk3_generic/src/com/stericson/RootTools/execution/Shell.java#60

proc = new ProcessBuilder(cmd).redirectErrorStream(true).start();
in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
out = new OutputStreamWriter(proc.getOutputStream(), "UTF-8");

UTF-8-Encoding is enabled for the output, but not for the input.

Original issue reported on code.google.com by [email protected] on 31 Mar 2013 at 3:32

RootTools.Result() Error

What steps will reproduce the problem?
1.Updated to RootTools 1.5
2.Followed usage example for sending root commands (the memory-saving way) 
3.Eclipse gives error on RootTools.Result()

What is the expected output? What do you see instead?

Eclipse gives the following error: The type new RootTools.Result(){} must 
implement the inherited abstract method RootTools.Result.processError(String)

What version of the product are you using? On what operating system?

RootTools 1.5 SDK3
Eclipse 3.6.2
Windows 7

Please provide any additional information below.

My code was in place and working in RootTools 0.9.3 and 1.1... The error 
occurred when I upgraded to 1.5. I performed a Project Clean in Eclipse, but 
the error persists. 

Original issue reported on code.google.com by [email protected] on 6 Jan 2012 at 8:35

Option to use for standard commands as well

I would first off like to thank you for making this library, I had been 
searching for something like this for quite some time.

I do have a suggestion though...

It would be nice to be able to run standard commands through this framework as 
well. 

I changed the source around so the Executer.sendShell function asks for a 
"useRoot" boolean parameter.

Then inside it where it declares the process, I put this:
process = Runtime.getRuntime().exec(useRoot ? "su" : "sh");

Cheers,
Corey

Original issue reported on code.google.com by [email protected] on 27 Jun 2011 at 1:53

Add Rootools to Maven repository

Hi,

As you may know, Gradle is becoming the standard way to compile an Android 
application.

And Gradle can download libraries from Maven.

It would be very good to upload Rootools to Maven so we can automatically 
download the latest version and have a better workflow.

Regards

Original issue reported on code.google.com by [email protected] on 11 Jul 2013 at 10:19

Expose getMounts() and the Mount class

It would be cool if you fully exposed getMounts() as a public API. I can call 
RootTools.getMounts(), but the Mount class is not visible, so I can't really 
use it.

Original issue reported on code.google.com by [email protected] on 5 Jul 2011 at 4:04

copyFile() doesn't check the exit status from "cp"

"cp" will return a nonzero exit status on error: if it lacks write permission, 
if it's writing to a read-only filesystem, if the filesystem is out of space, 
etc.  In all of these cases copyFile() should return false to notify the caller 
that there was an error.  That doesn't seem to be happening.

This was seen with v2.6, the latest stable release, and I'm attaching a patch 
tested ("cp" case only) against that version.  I have not tried the head of 
tree; the function looks a little different but I don't see any new exitCode 
checks in there.

BTW, in bug #24, there was a proposal to add a "newPermissions" argument to 
copyFile().  This would be a useful addition IMO, as incorrect permissions are 
a common pitfall of installing new scripts/binaries under /system.

Original issue reported on code.google.com by [email protected] on 9 Jul 2013 at 12:23

Attachments:

isAccessGiven() returns false when Superuser (com.noshufou.android.su) is installed

What steps will reproduce the problem?
1. Install Superuser (com.noshufou.android.su), an no other SU apps
2. Call isAccessGiven()
3. Observe lack of root permission dialog

What is the expected output? What do you see instead?
Expected popup dialog asking for root permission when calling isAccessGiven(). 
Instead, no popup and isAccessGiven() returns false.

What version of the product are you using? On what operating system?
Android 4.2.2, Galaxy Nexus, stock, rooted.

Please provide any additional information below.
If I uninstall com.noshufou.android.su and instead use 
com.koushikdutta.superuser, everything works as expected. I have a user "in the 
wild" that is experiencing the same issue.

Here's the logcat output from when isAccessGiven() fails:

06-28 10:20:56.735: D/RootTools v2.6(22101): Checking for Root access
06-28 10:20:56.735: D/RootTools v2.6(22101): Starting Root Shell!
06-28 10:20:56.735: D/RootTools v2.6(22101): Starting shell: su
06-28 10:20:56.829: W/System.err(22101): 
com.stericson.RootTools.exceptions.RootDeniedException: Root Access Denied
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:78)
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:291)
06-28 10:20:56.852: W/System.err(22101):    at 
com.stericson.RootTools.internal.RootToolsInternalMethods.isAccessGiven(RootTool
sInternalMethods.java:841)
06-28 10:20:56.852: W/System.err(22101):    at 
com.stericson.RootTools.RootTools.isAccessGiven(RootTools.java:636)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.StateChanger.requestRoot(StateChanger.java:100)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.SetupIntro.next(SetupIntro.java:123)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.SetupIntro.onActivityResult(SetupIntro.java:110
)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.Activity.dispatchActivityResult(Activity.java:5293)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.deliverResults(ActivityThread.java:3315)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.access$1100(ActivityThread.java:141)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
06-28 10:20:56.852: W/System.err(22101):    at 
android.os.Handler.dispatchMessage(Handler.java:99)
06-28 10:20:56.852: W/System.err(22101):    at 
android.os.Looper.loop(Looper.java:137)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.main(ActivityThread.java:5041)
06-28 10:20:56.852: W/System.err(22101):    at 
java.lang.reflect.Method.invokeNative(Native Method)
06-28 10:20:56.860: W/System.err(22101):    at 
java.lang.reflect.Method.invoke(Method.java:511)
06-28 10:20:56.860: W/System.err(22101):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-28 10:20:56.860: W/System.err(22101):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-28 10:20:56.860: W/System.err(22101):    at 
dalvik.system.NativeStart.main(Native Method)


Original issue reported on code.google.com by [email protected] on 28 Jun 2013 at 5:30

ForceClose On getShell()

What steps will reproduce the problem?
1. Roottools.getShell(true); // now will get force close

What is the expected output? What do you see instead?
-Nothing

What version of the product are you using? On what operating system?
Google nexus4 CM10.1 Stable-build 

Please provide any additional information below.
-----

Original issue reported on code.google.com by [email protected] on 9 Jul 2013 at 1:38

Multi process hang

> What steps will reproduce the problem?

1. run a command in a new thread and keep the command running
2. run another command in another thread

> What is the expected output? What do you see instead?

I would expect RootTools to spawn two shells and keep both processes running, 
but the second one does not start until the first is finished, unless i run 
them both with "command1 & command2" ... but i need them in two separate 
threads.

> What version of the product are you using? On what operating system?

RootTools 2.2 on Android 4.1.1

Original issue reported on code.google.com by [email protected] on 30 Aug 2012 at 8:14

method to check for busybox applets

Feature request

Method to check if a busybox applet is available.

RootTools.isBusyboxAppletAvailable("lsattr");

I check if busybox --list contains the applet, there is probably a 
easier/better way


Original issue reported on code.google.com by [email protected] on 23 Apr 2011 at 2:28

waitForFinish() does not wait for finish.

What steps will reproduce the problem?
1. Try to get a listing with waitForFinish:
    public static String getFirefoxCache() throws InterruptedException, IOException, TimeoutException, RootDeniedException {
        final StringBuffer out = new StringBuffer();
        String val = "";
        Command command = new Command(0,"ls /data/data/org.mozilla.firefox/files/mozilla/") {
            @Override
            public void output(int arg0, String dir) {
                //synchronized (out) {
                    if (dir.endsWith(".default")) {//TODO what if it's not on default profile?
                        out.append(dir);
                    }
                //}
            }
        };
        RootTools.getShell(true).add(command).waitForFinish();
        //synchronized(out) {
            val = out.toString();
        //}

        return val;
    }

What is the expected output? What do you see instead?
Instead of waiting for finish, waitForFinish() apparently does nothing but run 
the command.

What version of the product are you using? On what operating system?
2.6 on Android 2.2.2.

Please provide any additional information below.
Here's a more detailed description of the problem: 
http://stackoverflow.com/questions/16229891/concurrent-modification-exception-de
spite-waiting-for-finish

Original issue reported on code.google.com by [email protected] on 19 Jun 2013 at 6:24

Adding a non-returning command to a shell will trigger terminated timeout exception, even though it's not actually terminated.

What steps will reproduce the problem?
1. make a custom command:

            Command command = new Command(0, "tcpdump -nw /sdcard/test.cap") {

                @Override
                public void commandOutput(int id, String line)
                {
                }

                @Override
                public void commandCompleted(int id, int exitcode) {
                }

                @Override
                public void commandTerminated(int id, String reason) {
                    Toast.makeText(getApplicationContext(), "TCPdump was terminated. Reason:\n" + reason, Toast.LENGTH_LONG).show();
                }

            };

2. Make sure we don't have a custom shell running, then make custom shell (also 
happens with root shell btw), with infinite timeout (or say 99999999), and run 
it:

RootTools.closeCustomShell();
RootTools.getCustomShell("su", 0).add(command);


3. and wait..


What is the expected output? What do you see instead?

- Expected output: to not have the commandTerminated handler be called with a 
Timeout Exception.

- seen instead: the commandTerminated handler was called with a Timeout 
Exception. Exactly 20 seconds after the above code was called.


What is more, the tcpdump process wasn't actually killed:

# before running the above code:
shell@android:/ # ps | grep tcpdump
<no output>

# running code, before timeout exception:
root      31082 31072 3248   876   c0435ed4 40124b2c S 
/data/data/net.teclo.NeTrace/app_bins/tcpdump

# running code, after timeout exception:
shell@android:/ # ps | grep tcpdump
root      31082 31072 3248   876   c0435ed4 40124b2c S 
/data/data/net.teclo.NeTrace/app_bins/tcpdump


And handily I could also verify the resulting captures, and they showed the 
same data as the control capture.


What version of the product are you using? On what operating system?

This was on CyanogenMod, Android 4.2.2, roottools 3.0 and 3.1.


Cheers!

Original issue reported on code.google.com by [email protected] on 30 Jul 2013 at 2:49

question regarding rooting library

I am sorry about posting this question here.This is not an issue indeed it is a 
question for my better understanding to use. 
I am using your library to check if the device is rooted or not.Based on that 
my app is going to take action. I am not an expert in rooting. As part of the 
checks to confirm the device is rooted i am using your library functions for,
* locating su 
* locating SuperUser.apk
* running command like " ls /data/"

note that i have to determine this root checking programatically. So if any one 
of you help me adding more checks , i would really appreciate. Also please 
confirm the appropriation of the above checks !

regds
me

Original issue reported on code.google.com by [email protected] on 11 Jan 2012 at 2:36

checking root using "su"

You checking root throw using "su"(method InternalMethods.doExec() called from 
InternalMethods.returnPath()).

Call stack:
InternalMethods.doExec()
InternalMethods.returnPath()
RootTools.getPath()
RootTools.isRootAvailable()

I hope you'll find the way to get $path variable without root.

Original issue reported on code.google.com by [email protected] on 15 Sep 2011 at 3:09

How to get access to input stream of program?

I learn RootTools library for Android. And tried to use Python-program. I was 
able to run the program that:

String text = "busybox chroot /data/local/debian /usr/bin/python 
/usr/src/program.py";
Command command = new Command(0, text) {
   @Override
   public void output(int id, String line) {
      publishProgress(line);
   }
};
RootTools.getShell(true).add(command).waitForFinish();

But I do not know how to access the input stream of the program. This is 
necessary to continue the program.
i.e.
In console, I work with this Python-program that:

root@localhost:/# python program.py
Program started. Enter command:
>> command
result
>> anycommand
anyresult

But if I try to do this with RootTools

root@localhost:/# python program.py
Program started. Enter command:
root@localhost:/#

I hope that I clearly explained the situation(Sorry for my english)
Thanks

What version of the product are you using? On what operating system?
2.6


Original issue reported on code.google.com by [email protected] on 9 Mar 2013 at 9:45

setPermissions method

Please provide any additional information below.

a set permissions method you have a getter but no setter  

Original issue reported on code.google.com by [email protected] on 9 Mar 2012 at 10:44

Null pointer on executer.sendShell using result object

The problem occurs at line 107 of Executer class.
How to reproduce:
Try sending some command passing a IResult object with the method:
public List<String> sendShell(String[] commands, int sleepTime, IResult result, 
boolean useRoot)

In the finally you do:
if(null != result) {
  result.onComplete(diag);
  response.add(Integer.toString(diag));
  RootTools.lastExitCode = diag;
}

The problem is that when result!=null, response IS null because it hasn't been 
initialized so the response.add gives a null pointer exception that causes the 
caller to crash.

This is a very important issue

Original issue reported on code.google.com by [email protected] on 15 Nov 2011 at 2:34

Add a Busybox path setter

Hi,

In my application, I have embedded my own version of Busybox.

The reason is that I don't want to ask to the user to install Busybox before 
using my application.

This Busybox is inside /data/data/myapp.package.name/files/busybox

Moreover the Busybox versions available on the Play Store doesn't work on some 
devices.

Rootools use for some command Busybox.

It would be an easy and really usefull feature of Rootools library to be able 
to set the path to the executable we want to use.

Regards

Original issue reported on code.google.com by [email protected] on 11 Jul 2013 at 10:28

Missing Methods



What version of the product are you using? On what operating system?
RootTools-1.7 

Please provide any additional information below.

On the changelog is stated that we can use keepShell variable and OpenShell 
Method but this are unavailable 

Original issue reported on code.google.com by [email protected] on 28 Jun 2012 at 5:04

Error: write failed: EPIPE (Broken pipe)

Hello,

I don't know if I can raise issue, but here an issue I have when I when to set 
a property as I can do with a "adb shell setprop my.key my_value"

What steps will reproduce the problem?
1. Use RootTools.debugMode = true;
2. RootTools.useRoot = true;
3. if (RootTools.isRootAvailable()) {
    Log.i(TAG, "SU is available !");
    try {
     List<String> output = RootTools.sendShell("setprop my.key start", 5);
    } catch (IOException e) {
        // something went wrong, deal with it here
        e.printStackTrace();
        }
} else {
    Log.e(TAG, "SU is not available !");
}

What is the expected output? What do you see instead?
When I check getprop with:
adb shell getprop | grep my
I should see
[my.key]: [start]

But on logcat I can see:
Shell command: setprop my.key start
Error: write failed: EPIPE (Broken pipe)

What version of the product are you using? On what operating system?
RootTools v1.7


Please provide any additional information below.
I there any specific permission to use ?
Can I use this library on a app installed "normally" adb install app.apk ?

Original issue reported on code.google.com by [email protected] on 3 May 2012 at 3:36

getSymlinks will not work on every device

getSymlinks uses the shell command "find" that is not included in androids 
toolbox (see http://forum.xda-developers.com/showthread.php?t=1163846 ) and 
thus will not work on devices without busybox.

Have we other options without relying on find?

Original issue reported on code.google.com by [email protected] on 28 Feb 2012 at 1:33

Issue with RootTools.copyFile

What steps will reproduce the problem?
1. RootTools.copyFile(source, dest, true, true);

--------------------------------------------------------------------------------
--

What is the expected output? What do you see instead?
1. I tried "copyFile" on two database files and that worked.
2. But When I tried to open those databases in android using 
"SQLiteDatabase.openDatabase(database, null, 
SQLiteDatabase.NO_LOCALIZED_COLLATORS);" the first database opened without any 
issue but the second give me SQLiteException that unable to open, I tried it 
many times but no luck.
3. But when I copied the second database by executing "cat" command via 
RootTools with "su" and then tried to open the database it works like charm.

--------------------------------------------------------------------------------
--

What version of the product are you using? On what operating system?
1. RootTools-2.6
2. Android - 2.3.6
3. su binary - v3.1.1(17)
4. busy box - v1.21.0
5. MyOS - Ubuntu 13.04

--------------------------------------------------------------------------------
--

Please provide any additional information below.
It seems like that "copyFile" after copying the file has maintained a lock or 
something on that file but seriously I am no expert, that is what I observed.

Please let me know what else info I can provide...
Seriously this tool has helped me a lot.

Original issue reported on code.google.com by [email protected] on 9 May 2013 at 6: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.