{"id":381,"date":"2012-01-14T11:35:10","date_gmt":"2012-01-14T03:35:10","guid":{"rendered":"http:\/\/my.no-ip.info\/carlos\/blog\/?p=381"},"modified":"2012-01-14T11:36:23","modified_gmt":"2012-01-14T03:36:23","slug":"android-%e5%8f%96%e5%be%97-root-user-%e6%ac%8a%e9%99%90%e5%8e%9f%e7%90%86","status":"publish","type":"post","link":"https:\/\/carlos.aboutmy.info\/blog\/?p=381","title":{"rendered":"Android \u53d6\u5f97 root user \u6b0a\u9650\u539f\u7406"},"content":{"rendered":"<p>Android \u53d6\u5f97 root user \u6b0a\u9650\u539f\u7406\uff1a<br \/>\n(1) check what the number of processes limit is,<br \/>\n(2) check to see what process number the &#8220;adb shell&#8221; is running under,<br \/>\n(3) spawn, or make a bunch of useless processes to run the operating system up to its limit,<br \/>\n(4) kill the adb shell process, and then<br \/>\n(5) restart the adb shell.<\/p>\n<p>Since we are at limit-minus-one when the adb shell is killed off, starting the adb shell again puts us at exactly limit! The operating system then, for security, attempts to lower the user level of the adb shell&#8230;but it can&#8217;t! The operating system can&#8217;t run the one-more-process it needs to lower the shell from root to user level since the processes are maxed out.<\/p>\n<p>\u5927\u7d04\u5373\u662f\u539f\u4f86 Android adb \u9810\u8a2d\u63a5\u5165\u96fb\u8a71\u6642\u662f\u4ee5 root \u8eab\u4efd\u9023\u63a5\uff0c\u4e4b\u5f8c\u518d\u884c\u4e00\u500b\u7a0b\u5f0f\u628a\u7528\u8005\u964d\u70ba\u666e\u901a\u4f7f\u7528\u8005\u3002\u53d6\u5f97 root user \u6b0a\u9650\u539f\u7406\u5c31\u662f\u627e\u51fa\u7cfb\u7d71\u6700\u5927\u57f7\u884c\u7a0b\u5f0f\u6578\u548c adb \u7684 PID\uff0c\u4e4b\u5f8c\u4e0d\u65b7\u88fd\u544a\u7121\u7528\u7684\u7a0b\u5e8f\u4ee5\u9054\u5230\u7cfb\u7d71\u4e0a\u9650\uff0c\u518d\u91cd\u555f adb\uff0c\u90a3\u9ebc\u518d\u6b21\u9023\u5165\u6642\u56e0\u7121\u6cd5\u964d\u4f4e\u4f7f\u7528\u8005\u6b0a\u9650\uff0c\u9019\u6642\u4f7f\u7528\u8005\u5c31\u6709 root \u6b0a\u9650\u4e86<\/p>\n<p>\u9019\u6642\u53ea\u662f\u66ab\u6642\u7684 root \u6b0a\u9650<\/p>\n<p>Android 2.2 \u6216\u4ee5\u4e0b\u7684\u6211\u5011\u6703\u4f7f\u7528 psneuter\uff1b2.3 \u6703\u4f7f\u7528 gingerbreak \u9054\u5230\u53d6\u5f97\u66ab\u6642\u7684 root \u6b0a\u9650<\/p>\n<p>\u4e4b\u5f8c\u653e\u9032\u4e3b\u83dc\uff0c\u639b\u5165 \/system\uff0c\u628a su  \u9019\u500b\u7a0b\u5f0f\u653e\u5165 \/system\/bin\/\uff0csu \u662f \u4e00\u500b\u5728 Linux \u4e0a\u53ef\u4ee5\u4ee4\u4f7f\u7528\u8005\u8b8a root \u7684\u7a0b\u5f0f (\u5728 Linux \u4e0a\u8981\u6253 root \u7684 password)\uff0c\u4ee5\u5f8c Android \u4e0a\u7684 Apps \u53ea\u8981\u57f7\u884c su \u5c31\u53ef\u4ee5\u4ee5 root \u6b0a\u9650\u57f7\u884c<\/p>\n<p>\u4f46\u9019\u6a23\u5f88\u5371\u96aa\uff0c\u6545\u9700\u8981 superuser.apk \u9019\u500b App \u63a7\u5236\u90a3\u4e9b Apps \u53ef\u4ee5\u57f7\u884c su<\/p>\n<p>\u6700\u5f8c\u67d0\u4e9b\u9700\u8981 root \u6b0a\u9650\u7684 App \u7531\u653e\u529f\u80fd\u9700\u8981\uff0c\u6703\u7528\u5230 busybox\uff0c\u4e00\u500b\u628a Linux \u5de5\u5177\u7c21\u5316\u529f\u80fd\u5f8c\u96c6\u5408\u7684\u7a0b\u5f0f<\/p>\n<p>\u9019\u6642\u5c31\u5b8c\u7f8e root \u6a5f\u4e86\u3002\u624b\u52d5 root \u6a5f\u6700\u5b89\u5168\uff0c\u5514\u6015\u4ffe\u4eba\u690d\u5165\u4e0d\u77e5\u660e\u8edf\u4ef6\u3002\u7576\u7136\u60f3\u65b9\u4fbf\u7684\u8a71\u574a\u9593\u6709\u5f88\u591a\u4e00 click \u5373 root \u7684 App<\/p>\n<p>psneuter \u7684 source code \u6211\u90fd\u7747\u904e\uff0c\u7121\u554f\u984c\uff0c\u6709\u8208\u8da3\u53ef\u4ee5\u81ea\u5df1\u7747<br \/>\n<a href=\"https:\/\/github.com\/tmzt\/g2root-kmod\/blob\/master\/scotty2\/psneuter\/psneuter.c\">https:\/\/github.com\/tmzt\/g2root-kmod\/blob\/master\/scotty2\/psneuter\/psneuter.c<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android \u53d6\u5f97 root user \u6b0a\u9650\u539f\u7406\uff1a (1) check what the number of processes limit is, (2) check to see what process number the &#8220;adb shell&#8221; is running under, (3) spawn, or make a bunch of useless processes to run the operating system up to its limit, (4) kill the adb shell process, and then (5) restart\u2026 <span class=\"read-more\"><a href=\"https:\/\/carlos.aboutmy.info\/blog\/?p=381\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/381"}],"collection":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=381"}],"version-history":[{"count":0,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/381\/revisions"}],"wp:attachment":[{"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carlos.aboutmy.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}