Git Product home page Git Product logo

Comments (9)

Stericson avatar Stericson commented on July 29, 2024

This looks like an issue with Root.

Make sure that the following is true:

  1. Root is properly configured on your device.
  2. You are granting Root permission to your application

If the above doesn't work, there may still be an issue with root on your device.

  1. Try re-rooting your phone, did this resolve the issue?

If non of the above help can you provide me with the code that is causing the issue?

from roottools.

think-android avatar think-android commented on July 29, 2024

Hi there, thanks a lot for your answer.

The code try to do "pm uninstall ...".

It does work in the shell, SuperSU pop up for access and so on:
su --context u:r:system_app:s0 -c "pm uninstall com.example.app" < /dev/null

The app is listed in superSU as well, as allowed. But it crash somethere. I'm trying to get the SuperSU logs to see what command will be fire at the end.

I post my code later (have to boot my other PC).

from roottools.

think-android avatar think-android commented on July 29, 2024

This is the part:

Command command = new Command(0, false, "pm uninstall " + packageName) {
@OverRide
public void commandCompleted(int arg0, int arg1) {
}

        @Override
        public void commandOutput(int arg0, String arg1) {
            Log.d("LOG_TAG",arg1);
            if (arg1.toLowerCase(Locale.US).contains(String.valueOf("Failure").toLowerCase(Locale.US))
                    || arg1.toLowerCase(Locale.US).contains(String.valueOf("Error").toLowerCase(Locale.US))
                    || arg1.toLowerCase(Locale.US).contains(String.valueOf("denied").toLowerCase(Locale.US))
                ) {
                try {
                    throw new Exception(arg1);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                Notification.Builder errorBuilder = new Notification.Builder(RootUninstallIntentService.this);
                errorBuilder.setContentTitle(appLabel)
                        .setAutoCancel(true)
                        .setContentIntent(PendingIntent.getActivity(RootUninstallIntentService.this, 0, new Intent(), 0))
                        .setContentText(arg1)
                        .setColor(getResources().getColor(R.color.primary))
                        .setSmallIcon(R.drawable.noti_icon);
                mNotifyManager.notify(Common.NOTI_ID_RESTORE_ERROR + ((Long) System.currentTimeMillis()).intValue(), errorBuilder.build());
            }
        }

        @Override
        public void commandTerminated(int arg0, String arg1) {
        }
    };
    synchronized (command) {
        try {
            RootTools.debugMode=true;
            Shell shell = RootTools.getShell(true, Shell.ShellContext.SYSTEM_APP);
            shell.add(command);
            command.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (RootDeniedException e) {
            e.printStackTrace();
        } catch (TimeoutException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

from roottools.

think-android avatar think-android commented on July 29, 2024

One thing I forget, the code will be call from a IntentService.

from roottools.

think-android avatar think-android commented on July 29, 2024

So, I got SuperSU PRO and can provide more logs now.

This code:

    Command command = new Command(0, "pm uninstall " + packageName)
    {
        @Override
        public void commandOutput(int id, String line) {
            Log.d("######## ", line);
        }

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

        }

        @Override
        public void commandCompleted(int id, int exitCode) {

        }
    };
    try {
        RootTools.getShell(true).add(command);
    } catch (IOException e) {
        e.printStackTrace();
    } catch (TimeoutException e) {
        e.printStackTrace();
    } catch (RootDeniedException e) {
        e.printStackTrace();
    }

got this superSU logs:

screenshot_2014-11-03-12-16-33

if I change
RootTools.getShell(true).add(command);
to
RootTools.getShell(true, Shell.ShellContext.SYSTEM_APP).add(command);

SuperSU says:
screenshot_2014-11-03-12-16-39

from roottools.

think-android avatar think-android commented on July 29, 2024

So, I've got your code and did some debug.

the code:
RootTools.getShell(true, Shell.ShellContext.SYSTEM_APP).add(command);

Shell.java / Worker class:
.......
if (line == null) {
throw new EOFException();
}
.......
the EOFException will be fired, so it seems line==null

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Let me do some testing on this....I'll reach back out to you...

from roottools.

think-android avatar think-android commented on July 29, 2024

Thank you very much. If you need more info or logs or whatever, just tell a word.

from roottools.

Stericson avatar Stericson commented on July 29, 2024

Can you try this new version?

https://drive.google.com/file/d/0B5Amguus3csDQW1zV04waEhXNkE/view?usp=sharing

Let me know if you see the same issue?

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.