Android:adbd 无法在生产版本中以 root 身份运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25271878/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:17:08  来源:igfitidea点击:

Android: adbd cannot run as root in production builds

androidadbroot

提问by Dave

I have an Android-based phone (2.3.6) with unlocked root privileges. Since i'd like to have access to my phone through my computer, today i've installed QtAdb and Android SDK. If i open a command prompt and i do

我有一部基于 Android 的手机 (2.3.6),具有解锁的 root 权限。因为我想通过我的电脑访问我的手机,今天我安装了 QtAdb 和 Android SDK。如果我打开命令提示符并且我这样做

adb shell su

adb shell su

i get

我明白了

#

#

And so I am able to copy, remove, push files on my phone (on the phone i get a notification using the app "SuperSU".)

所以我可以在我的手机上复制、删除、推送文件(在手机上我使用应用程序“SuperSU”收到通知。)

But if i launch QtAdb - under Windows 7 - i get the following error: "adbd cannot run as root in production builds". I miss something? There's something wrong with QtAdb?

但是,如果我启动 QtAdb - 在 Windows 7 下 - 我会收到以下错误:“adbd 无法在生产版本中以 root 身份运行”。我想念什么?QtAdb 有问题吗?

回答by David Ljung Madison Stellar

The problem is that, even though your phone is rooted, the 'adbd' server on the phone does not use root permissions. You can try to bypass these checks or install a different adbd on your phone or install a custom kernel/distribution that includes a patched adbd.

问题是,即使您的手机已 root,手机上的“adbd”服务器也不使用 root 权限。您可以尝试绕过这些检查或在手机上安装不同的 adbd,或安装包含修补过的 adbd 的自定义内核/发行版。

Or, a much easier solution is to use 'adbd insecure' from chainfire which will patch your adbd on the fly. It's not permanent, so you have to run it before starting up the adb server (or else set it to run every boot). You can get the app from the google play store for a couple bucks:

或者,一个更简单的解决方案是使用 chainfire 中的“adbd insecure”,它会即时修补您的 adbd。它不是永久性的,因此您必须在启动 adb 服务器之前运行它(或者将其设置为每次启动都运行)。您可以花几美元从 google play 商店获得该应用程序:

https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en

https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en

Or you can get it for free, the author has posted a free version on xda-developers:

或者你可以免费获得,作者在xda-developers上发布了一个免费版本:

http://forum.xda-developers.com/showthread.php?t=1687590

http://forum.xda-developers.com/showthread.php?t=1687590

Install it to your device (copy it to the device and open the apk file with a file manager), run 'adb insecure' on the device, and finally kill the adb server on your computer:

将其安装到您的设备上(将其复制到设备并使用文件管理器打开 apk 文件),在设备上运行“adb insecure”,最后在您的计算机上杀死 adb 服务器:

% adb kill-server

% adb 杀死服务器

And then restart the server and it should already be root.

然后重新启动服务器,它应该已经是 root 了。

回答by Yong Yang

You have to grant the Superuserright to the shell app (com.anroid.shell). In my case, I use Magiskto root my phone Nexsus 6P (Oreo 8.1). So I can grant Superuserright in the Magisk Managerapp, whih is in the left upper option menu.

您必须授予Superusershell 应用程序的权限 ( com.anroid.shell)。就我而言,我使用Magisk来根我的手机 Nexsus 6P (Oreo 8.1)。所以我可以SuperuserMagisk Manager应用程序中授予权限,在左上方的选项菜单中。