android apk 的root 許可權和USB adb 許可權的區別

來源:互聯網
上載者:User

標籤:des   android   http   使用   for   sp   檔案   bs   ad   

USB adb 許可權是指,當adb 串連手機時,手機中的守護進程adbd 的許可權為root 許可權,從而它的子進程也具有root 許可權,通常如果adb shell 看到是:
Android 4.0 以後版本:
C:\Users\mtk29\Desktop>adb shell
[email protected]:/ #
Android 2.3 版本:
C:\Users\mtk29\Desktop>adb shell


即表明adb 的串連是root 許可權的,相反如果看到是$ 即表明是shell 許可權
Android 的APK 本身都是不具備root 許可權的,如果想啟用root 許可權,那麼就必須藉助具有root 許可權的進程或者具有s bit 的檔案,目前比較通用的手法是,手機root 後,內建了su到system/bin, 然後普通APP 即可藉助su 命令來達到root 許可權切換。 
網路上已經有同仁修改su 命令,並通過一個APK 來控制su 命令的許可權控制。
如常見的Superuser: http://androidsu.com/superuser/ 這樣即可人為的控制root 許可權的使用。((因很久都沒有更新了,只能用於ICS 以及以前的版本))
        SuperSU: http://forum.xda-developers.com/showthread.php?t=1538053 (更新速度很快,推薦使用)
 
綜上所敘,如果adb 已經有root 許可權,那麼讓apk 行使root 許可權就很簡單了。比如在JB 版本或者以前的版本上:
adb remount
adb push su /system/bin
adb push Superuser.apk /system/app
adb shell chmod 0644 /system/app/Superuser.apk
adb shell chmod 6755 /system/bin/su
adb reboot

android apk 的root 許可權和USB adb 許可權的區別

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.