adb shell su는 작동하지만 adb root는 작동하지 않습니다.
잠금 해제 된 Galaxy S3 (SGH-T999)를 루팅했습니다.
이제 adb root
Windows Command Prompt 에서 실행하려고하는데 adbd cannot run as root in production builds
오류 가 발생합니다. 그래서, 내가 가장 먼저 확인한 것은 내 전화가 정말로 루팅되었는지 여부였습니다.
그래서 다음을 시도했습니다.
명령 프롬프트 열기
$adb devices // lists my device
$adb shell //goes to shell
$su // opens a 'SuperSu' prompt on my phone and I 'Grant' permission
# // Before following the rooting instructions, I was getting 'no su command found' in the previous step. So, I believe my phone is ROOTED. **Correct me if I'm wrong.**
내가 할 때, adb root
내가 얻을 adbd cannot run as root in production builds
오류입니다. 그래서 위에서했던 것 외에 몇 가지 추가 작업을해야 할 수도 있다고 생각했습니다. 다음 질문에 대한 모든 솔루션을 시도했습니다.
- ADB를 통해 루트로 스크립트 시작
- adb remount 권한이 거부되었지만 셸에서 슈퍼 사용자에 액세스 할 수 있음-android
- 루팅 된 Android 휴대폰에서 'adb root'를 실행할 수 없습니다.
위의 어느 것도 나를 위해 일하지 않았습니다. 그들이하는 일은 SHELL 내부의 ROOT 액세스 권한을 부여하는 것뿐입니다. adb root
셸에 들어 가지 않고도 다양한 adb 명령을 실행할 수 있도록 작업 하고 싶습니다 .
일부 개발자 친화적 인 ROM 에서는 설정> 개발자 옵션> 루트 액세스 에서 루트 액세스 를 활성화 할 수 있습니다 . 그 후 adb root
사용할 수 있습니다. 안타깝게도 시장에 나와있는 대부분의 재고 ROM에서는 작동하지 않습니다.
설계에 의해 adb root
개발 명령이 작동 빌드 만 (즉, eng
그리고 userdebug
이는이 ro.debuggable=1
기본적으로). 따라서 루팅 된 장치 에서 adb root
명령 을 활성화 하려면 다음 파일 중 하나에 해당 줄을 추가하십시오 .ro.debuggable=1
/system/build.prop
/system/default.prop
/data/local.prop
기본적 adb shell
으로 시작 하려면 root
추가하십시오 ro.secure=0
.
또는 당신은 수정 사용할 수 있습니다 adbd
(확인하지 않는 바이너리 ro.debuggable
)
에서 https://android.googlesource.com/platform/system/core/+/master/adb/daemon/main.cpp
#if defined(ALLOW_ADBD_ROOT)
// The properties that affect `adb root` and `adb unroot` are ro.secure and
// ro.debuggable. In this context the names don't make the expected behavior
// particularly obvious.
//
// ro.debuggable:
// Allowed to become root, but not necessarily the default. Set to 1 on
// eng and userdebug builds.
//
// ro.secure:
// Drop privileges by default. Set to 1 on userdebug and user builds.
나는 뿌리 삼성 갤럭시 트렌드 플러스 (GT-S7580)를 가지고 있습니다.
'adb root'를 실행하면 동일한 'adbd가 프로덕션 빌드에서 루트로 실행할 수 없습니다'오류가 발생합니다.
개발자 옵션-> 루트 액세스 권한이있는 기기의 경우 'ADB 전용'을 선택하여 기기에 대한 adb 루트 액세스 권한을 제공합니다 ( NgaNguyenDuy에서 제안 함 ).
그런 다음 ADB를 통해 루트로 스크립트 실행 에서 솔루션에 따라 명령을 실행 해보십시오 . 제 경우에는 'netcfg rndis0 dhcp'명령을 실행하고 싶었고 이렇게했습니다.
adb shell "su -c netcfg rndis0 dhcp"
이런 식으로 실행하는 동안 실수가 있는지 확인하십시오.
그래도 작동하지 않으면 장치를 올바르게 루팅했는지 확인하십시오. 여전히 운이 없으면 'adb root'가 작동하도록 Cyanogen Mod 와 같은 사용자 정의 ROM을 설치해보십시오 .
boot.img / sbin / 폴더에있는 adbd 바이너리를 su 가능한 바이너리로 바꿔야합니다. 또한 default.prop 편집도해야합니다.
삼성은 다른 벤더보다 이것을 더 어렵게 만드는 것 같습니다. 시도해 볼 수있는 adbd 바이너리가 있지만 새 바이너리로 boot.img를 디 컴파일하고 다시 컴파일하는 지식이 필요합니다. 또한 잠긴 부트 로더가 있다면 ... 이런 일은 일어나지 않을 것입니다.
또한 Chainfire에는 Play 스토어에서 adbd 루트 권한을 부여하는 앱이 있습니다. https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en
마지막으로, SU 권한이있는 Windows 스크립트를 작성하려는 경우 다음 명령 스타일을 사용하여이 구매를 수행 할 수 있습니다. 그러나 적어도 처음 실행될 때 (전화에서) SU 권한을 부여해야합니다 .. .
adb shell "su -c ls"<-su 권한이있는 작업 디렉토리 나열. adb 쉘 "su -c echo anytext> /data/test.file"
These are just some examples. If you state specifically what you are trying to accomplish I may be able to give more specific advice
-scosler
I use for enter su mode in abd shell
adb shell "su"
I ran into this issue when trying to root the emulator, I found out it was because I was running the Nexus 5x emulator which had Google Play on it. Created a different emulator that didn't have google play and adb root
will root the device for you. Hope this helps someone.
If you really need to have ADB
running as root
, the quickest and easiest way is to install Android Custom ROMs and the most popular is CyanogenMod
for it has the Root Access
options in developer options menu where you can choose to give root access to apps and ADB
. I used CM before but since it wasn't developed anymore, I tried looking for some solutions out there. Although CyanogenMod is still a good alternative because it does not have bloatware.
One alternative I found out from a friend is using adbd insecure
app which you could try from here: https://forum.xda-developers.com/showthread.php?t=1687590. In my case, it works perferct with an Android custom kernel, but not with the Android stock ROM (vanilla android only). You may try other alternatives too like modifying boot.img
of the Android ROM.
adbd
has a compilation flag/option to enable root access: ALLOW_ADBD_ROOT=1
.
Up to Android 9: If adbd
on your device is compiled without that flag, it will always drop privileges when starting up and thus "adb root" will not help at all. I had to patch the calls to setuid()
, setgid()
, setgroups()
and the capability drops out of the binary myself to get a permanently rooted adbd on my ebook reader.
With Android 10 this changed; when the phone/tablet is unlocked (ro.boot.verifiedbootstate == "orange"
), then adb root mode is possible in any case.
참고URL : https://stackoverflow.com/questions/25477424/adb-shell-su-works-but-adb-root-does-not
'Development Tip' 카테고리의 다른 글
Rails has_one : 연결을 통해 (0) | 2020.11.18 |
---|---|
.NET의 System.Version이 Major.Minor.Build.Revision으로 정의 된 이유는 무엇입니까? (0) | 2020.11.18 |
.NET / C #에서 SVG 그리기? (0) | 2020.11.18 |
C ++ 용 '즉시 사용 가능한'2D / 3D 플로팅 라이브러리가 있습니까? (0) | 2020.11.18 |
__init__.py 사용 (0) | 2020.11.18 |