现在的位置: 首页 > 综合 > 正文

adbd cannot run as root in production builds

2013年11月06日 ⁄ 综合 ⁄ 共 849字 ⁄ 字号 评论关闭

adb root 后为什么出现
“adbd cannot run as root in production builds”
看看下面的代码就懂了,你也会知道怎么去改了!

~/mywork/403-sync/system/core/adb/services.c/ 

110 void restart_root_service(int fd, void *cookie)
111 {
112     char buf[100];
113     char value[PROPERTY_VALUE_MAX];
114 
115     if (getuid() == 0) {
116         snprintf(buf, sizeof(buf), "adbd is already running as root\n");
117         writex(fd, buf, strlen(buf));
118         adb_close(fd);
119     } else {
120         property_get("ro.debuggable", value, "");
121         if (strcmp(value, "1") != 0) {
122             snprintf(buf, sizeof(buf), "adbd cannot run as root in production builds\n");
123             writex(fd, buf, strlen(buf));
124             adb_close(fd);
125             return;
126         }
127 
128         snprintf(buf, sizeof(buf), "restarting adbd as root\n");
129         writex(fd, buf, strlen(buf));
130         adb_close(fd);
131 
132         // This will cause a property trigger in init.rc to restart us
133         property_set("service.adb.root", "1");
134     }
135 }

抱歉!评论已关闭.