java - Execute Shell command in android app -


i have android app rooted phone in trying disable application using shell command.

try {     process process = runtime.getruntime().exec("su -c 'pm disable com.bt.bms'");     inputstreamreader reader = new inputstreamreader(process.getinputstream());     bufferedreader bufferedreader = new bufferedreader(reader);     int numread;     char[] buffer = new char[5000];     stringbuffer commandoutput = new stringbuffer();     while ((numread = bufferedreader.read(buffer)) > 0) {         commandoutput.append(buffer, 0, numread);     }     bufferedreader.close();     process.waitfor();     xposedbridge.log(commandoutput.tostring()); } catch (ioexception e) {     throw new runtimeexception(e); } catch (interruptedexception e) {     throw new runtimeexception(e); } 

whenever execute see toast notification "system ui has been granted permissions: pm disable com.bt.bms " app not getting disabled. whereas when run same command in terminal, works fine.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -