Comments (9)
This looks like an issue with Root.
Make sure that the following is true:
- Root is properly configured on your device.
- 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.
- 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.
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.
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.
One thing I forget, the code will be call from a IntentService.
from roottools.
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:
if I change
RootTools.getShell(true).add(command);
to
RootTools.getShell(true, Shell.ShellContext.SYSTEM_APP).add(command);
from roottools.
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.
Let me do some testing on this....I'll reach back out to you...
from roottools.
Thank you very much. If you need more info or logs or whatever, just tell a word.
from roottools.
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)
- 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
- How to Rename a File in /System/ HOT 2
- .
- 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.