Is there a way to give root privileges to an app through the ADB?










2















The Android Debug Bridge (ADB) itself has root access (after executing the adb root command). Can that be used to give the same privileges to apps on the device? Is there a file somewhere in the system that keeps track of which user (app) has root access and can it be modified? If it helps I've already put the app in the system folder so it's regarded as a system app now.










share|improve this question


























    2















    The Android Debug Bridge (ADB) itself has root access (after executing the adb root command). Can that be used to give the same privileges to apps on the device? Is there a file somewhere in the system that keeps track of which user (app) has root access and can it be modified? If it helps I've already put the app in the system folder so it's regarded as a system app now.










    share|improve this question
























      2












      2








      2








      The Android Debug Bridge (ADB) itself has root access (after executing the adb root command). Can that be used to give the same privileges to apps on the device? Is there a file somewhere in the system that keeps track of which user (app) has root access and can it be modified? If it helps I've already put the app in the system folder so it's regarded as a system app now.










      share|improve this question














      The Android Debug Bridge (ADB) itself has root access (after executing the adb root command). Can that be used to give the same privileges to apps on the device? Is there a file somewhere in the system that keeps track of which user (app) has root access and can it be modified? If it helps I've already put the app in the system folder so it's regarded as a system app now.







      applications adb root-access






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 10:41









      StormtrooperStormtrooper

      182




      182




















          1 Answer
          1






          active

          oldest

          votes


















          3














          Nope. Though you could use e.g. pm grant and grant it SUPERUSER, but that would have no effect if the app hadn't declared that in its manifest. And if it had, it wouldn't be necessary to grant it manually.



          An app must actively request superuser privileges in order to gain it – and even then it only works with a superuser app in place (acting as "gate keeper") that then pops up a message for the user to confirm.






          share|improve this answer























          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

            – Stormtrooper
            Nov 14 '18 at 11:32






          • 1





            If it could be done without a superuser app, it would be too bad – for security :)

            – Izzy
            Nov 14 '18 at 12:38











          • True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

            – Stormtrooper
            Nov 14 '18 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?

            – Raimund Krämer
            Nov 14 '18 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

            – Izzy
            Nov 14 '18 at 15:56










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "139"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f203850%2fis-there-a-way-to-give-root-privileges-to-an-app-through-the-adb%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          Nope. Though you could use e.g. pm grant and grant it SUPERUSER, but that would have no effect if the app hadn't declared that in its manifest. And if it had, it wouldn't be necessary to grant it manually.



          An app must actively request superuser privileges in order to gain it – and even then it only works with a superuser app in place (acting as "gate keeper") that then pops up a message for the user to confirm.






          share|improve this answer























          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

            – Stormtrooper
            Nov 14 '18 at 11:32






          • 1





            If it could be done without a superuser app, it would be too bad – for security :)

            – Izzy
            Nov 14 '18 at 12:38











          • True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

            – Stormtrooper
            Nov 14 '18 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?

            – Raimund Krämer
            Nov 14 '18 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

            – Izzy
            Nov 14 '18 at 15:56















          3














          Nope. Though you could use e.g. pm grant and grant it SUPERUSER, but that would have no effect if the app hadn't declared that in its manifest. And if it had, it wouldn't be necessary to grant it manually.



          An app must actively request superuser privileges in order to gain it – and even then it only works with a superuser app in place (acting as "gate keeper") that then pops up a message for the user to confirm.






          share|improve this answer























          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

            – Stormtrooper
            Nov 14 '18 at 11:32






          • 1





            If it could be done without a superuser app, it would be too bad – for security :)

            – Izzy
            Nov 14 '18 at 12:38











          • True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

            – Stormtrooper
            Nov 14 '18 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?

            – Raimund Krämer
            Nov 14 '18 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

            – Izzy
            Nov 14 '18 at 15:56













          3












          3








          3







          Nope. Though you could use e.g. pm grant and grant it SUPERUSER, but that would have no effect if the app hadn't declared that in its manifest. And if it had, it wouldn't be necessary to grant it manually.



          An app must actively request superuser privileges in order to gain it – and even then it only works with a superuser app in place (acting as "gate keeper") that then pops up a message for the user to confirm.






          share|improve this answer













          Nope. Though you could use e.g. pm grant and grant it SUPERUSER, but that would have no effect if the app hadn't declared that in its manifest. And if it had, it wouldn't be necessary to grant it manually.



          An app must actively request superuser privileges in order to gain it – and even then it only works with a superuser app in place (acting as "gate keeper") that then pops up a message for the user to confirm.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 11:21









          IzzyIzzy

          76.6k49249756




          76.6k49249756












          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

            – Stormtrooper
            Nov 14 '18 at 11:32






          • 1





            If it could be done without a superuser app, it would be too bad – for security :)

            – Izzy
            Nov 14 '18 at 12:38











          • True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

            – Stormtrooper
            Nov 14 '18 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?

            – Raimund Krämer
            Nov 14 '18 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

            – Izzy
            Nov 14 '18 at 15:56

















          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

            – Stormtrooper
            Nov 14 '18 at 11:32






          • 1





            If it could be done without a superuser app, it would be too bad – for security :)

            – Izzy
            Nov 14 '18 at 12:38











          • True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

            – Stormtrooper
            Nov 14 '18 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?

            – Raimund Krämer
            Nov 14 '18 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

            – Izzy
            Nov 14 '18 at 15:56
















          Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

          – Stormtrooper
          Nov 14 '18 at 11:32





          Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.

          – Stormtrooper
          Nov 14 '18 at 11:32




          1




          1





          If it could be done without a superuser app, it would be too bad – for security :)

          – Izzy
          Nov 14 '18 at 12:38





          If it could be done without a superuser app, it would be too bad – for security :)

          – Izzy
          Nov 14 '18 at 12:38













          True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

          – Stormtrooper
          Nov 14 '18 at 12:45






          True but after the ADB is allowed you can already compromise security in many ways. I've tried making my app a system one on two different devices. On one making the app a system one automatically gave it root privileges but in the seconds case it does not... Better security I guess.

          – Stormtrooper
          Nov 14 '18 at 12:45














          Does that mean that granting SUPERUSER with pm grant effectively does nothing?

          – Raimund Krämer
          Nov 14 '18 at 15:48






          Does that mean that granting SUPERUSER with pm grant effectively does nothing?

          – Raimund Krämer
          Nov 14 '18 at 15:48














          Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

          – Izzy
          Nov 14 '18 at 15:56





          Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.

          – Izzy
          Nov 14 '18 at 15:56

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Android Enthusiasts Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fandroid.stackexchange.com%2fquestions%2f203850%2fis-there-a-way-to-give-root-privileges-to-an-app-through-the-adb%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3

          Museum of Modern and Contemporary Art of Trento and Rovereto