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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}






up vote
2
down vote

favorite












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




























    up vote
    2
    down vote

    favorite












    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
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      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 at 10:41









      Stormtrooper

      182




      182






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          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 at 11:32






          • 1




            If it could be done without a superuser app, it would be too bad – for security :)
            – Izzy
            Nov 14 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 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?
            – Raimund Krämer
            Nov 14 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
            – Izzy
            Nov 14 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',
          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








          up vote
          3
          down vote



          accepted










          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 at 11:32






          • 1




            If it could be done without a superuser app, it would be too bad – for security :)
            – Izzy
            Nov 14 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 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?
            – Raimund Krämer
            Nov 14 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
            – Izzy
            Nov 14 at 15:56















          up vote
          3
          down vote



          accepted










          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 at 11:32






          • 1




            If it could be done without a superuser app, it would be too bad – for security :)
            – Izzy
            Nov 14 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 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?
            – Raimund Krämer
            Nov 14 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
            – Izzy
            Nov 14 at 15:56













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          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 at 11:21









          Izzy

          75.7k49240740




          75.7k49240740












          • Ah, I had hoped it could be done without a superuser app. Too bad but thanks for your time.
            – Stormtrooper
            Nov 14 at 11:32






          • 1




            If it could be done without a superuser app, it would be too bad – for security :)
            – Izzy
            Nov 14 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 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?
            – Raimund Krämer
            Nov 14 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
            – Izzy
            Nov 14 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 at 11:32






          • 1




            If it could be done without a superuser app, it would be too bad – for security :)
            – Izzy
            Nov 14 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 at 12:45












          • Does that mean that granting SUPERUSER with pm grant effectively does nothing?
            – Raimund Krämer
            Nov 14 at 15:48












          • Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
            – Izzy
            Nov 14 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 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 at 11:32




          1




          1




          If it could be done without a superuser app, it would be too bad – for security :)
          – Izzy
          Nov 14 at 12:38




          If it could be done without a superuser app, it would be too bad – for security :)
          – Izzy
          Nov 14 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 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 at 12:45














          Does that mean that granting SUPERUSER with pm grant effectively does nothing?
          – Raimund Krämer
          Nov 14 at 15:48






          Does that mean that granting SUPERUSER with pm grant effectively does nothing?
          – Raimund Krämer
          Nov 14 at 15:48














          Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
          – Izzy
          Nov 14 at 15:56




          Granting anything an app has not in its manifest does nothing AFAIK, @RaimundKrämer.
          – Izzy
          Nov 14 at 15:56


















           

          draft saved


          draft discarded



















































           


          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







          Popular posts from this blog

          Сан-Квентин

          8-я гвардейская общевойсковая армия

          Алькесар