1

I want to execute the command "pm grant com.example.xy android.permission.CHANGE_CONFIGURATION" inside the app.

     Process p;
     try {
         p = Runtime.getRuntime().exec("pm grant com.example.xy android.permission.CHANGE_CONFIGURATION");
         p.waitFor();
         BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));

         String line = "";
         while ((line = reader.readLine())!= null) {
             output.append(line + "n");
             Log.e("splash", "error " + output.append(line + "n"));
         }

     } catch (Exception e) {
         Log.e("splash", "error " + e.toString());

         e.printStackTrace();
     }
     String response = output.toString();
     return response;

This have no effect. Have anyone a solution for this?

dev4678
  • 11
  • 4
  • Possible duplicate of [Is it possible to execute ADB shell commands from app?](http://stackoverflow.com/questions/28785411/is-it-possible-to-execute-adb-shell-commands-from-app) – Alex P. Aug 18 '16 at 16:50
  • the answer to your question is in the upvoted comment to the answer to the question I linked (I wish Chris would post it as a separate answer) – Alex P. Aug 18 '16 at 16:54

0 Answers0