Make Android isProbablyRooted work with adb root#165
Make Android isProbablyRooted work with adb root#165pimterry merged 1 commit intohttptoolkit:mainfrom
Conversation
|
Good point! Yes it would be good to cover this case better. That said, this is indeed quite heavy on the phone, and we run this check very frequently when polling device statuses, so we can't really do the whole check every time. What about if we just extend the current logic here to run |
f90be14 to
c40888b
Compare
|
Seems reasonable to me. I considered it when I made the initial changes, but was unsure if it would be acceptable. I'm quite certain that I will most likely forget to do this in the future, but it seems quite reasonable that if the commands currently being run over adb are as root, then it should work. I added the comment just for a small clarification, but not sure if it actually provides any additional information :) Open for any suggestions. |
|
Merged, thanks! By the way, in case you're not aware, HTTP Toolkit Pro is free for all contributors to all https://github.com/httptoolkit repos. If that would be useful, just let me know your email (either here or by sending a message to opensource @ httptoolkit.com) and I'll set you up with an account. |
Make Android isProbablyRooted work with adb root
Reuses the logic from
getRootCommandto do root detection.The logic in
getRootCommandis fairly heavy on the phone, so it might not be ideal to reuse it in this way, asisProbablyRootedis ran fairly often,But I can't really find any better way doing this, as e.g. when running a LineageOS phone with rooted adb the check for
suwill fail, as it does not exist on the phone.I considered keeping the previous check, and only running this command if that fails, but it seems nicer to reuse the logic (less nice that a file is pushed to the device on each invocation).