如何在系統終端app獲得root許可權

來源:互聯網
上載者:User

標籤:android   style   http   ar   os   sp   檔案   on   art   

最新因為要調試USB OTG的東西,這樣導致USB口被佔用,這樣,雖然我是工程版本,但是不能執行adb shell,導致無法debug了。
於是我現在了一個系統終端的apk,程式 http://download.csdn.net/detail/zangcf/8172151,解包提取so檔案libExec.so,放到system/lib下面,原始碼放到。./alps/vendor/mediatek/project_xxx/artifacts/out/target/product/project_xxx/system/lib。把來源程式檔案放到./alps/vendor/mediatek/project_xxx/artifacts/out/target/product/project_xxx/system/app/下
修改/media/zangcf/works/android/mtk/6572/carpad/alps_add_ics_ethernet/system/extras/su/su.c,刪除一下
/*
    myuid = getuid();
    if (myuid != AID_ROOT && myuid != AID_SHELL) {
        fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
        return 1;
    }
*/
這一段代碼
另外,在post過程中修改su的屬性為24775
在原始碼中修改Init.rc,添加./alps/mediatek/config/mt6572/init.rc添加chmod 24755 /system/xbin/su。
然後重新編譯,及可以在shell終端執行su,shell的提示符從$,變為#,表示切換成功。

如何在系統終端app獲得root許可權

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.