Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect command in ADB cert injection script #122

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

julio-b
Copy link
Contributor

@julio-b julio-b commented Jun 21, 2024

Fixes: 59f013f

@CLAassistant
Copy link

CLAassistant commented Jun 21, 2024

CLA assistant check
All committers have signed the CLA.

@julio-b
Copy link
Contributor Author

julio-b commented Jun 21, 2024

Injection script was failing with this error:

Android command [ 'su', 'root', 'sh', '/data/local/tmp/htk-inject-system-cert.sh' ] returned `
---
Injecting certificate:
chown: user '700': No such file or directory`
Error: System certificate injection failed
    at e.injectSystemCertificate (/opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:953:29569)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async e.AndroidAdbInterceptor.injectSystemCertIfPossible (/opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:953:34251)
    at async e.AndroidAdbInterceptor.activate (/opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:953:31986)
    at async e.ApiModel.activateInterceptor (/opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:899:756023)
    at async /opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:953:3549
    at async /opt/HTTP Toolkit/resources/httptoolkit-server/bundle/index.js:953:2121

@pimterry pimterry merged commit 9822ae3 into httptoolkit:main Jun 21, 2024
13 checks passed
@pimterry
Copy link
Member

Obviously this is a bug (good find, thanks!) but interestingly this does work on my Android test device, and even on my local linux machine - it just changes the folder to be owned by uid 700, even if an actual user with that id doesn't exist. Curious!

Out of interest, what device are you using where this fails?

Anyway, thanks for fixing this, I'll put out a release to resolve that for everybody shortly.

Just in case you're not aware, HTTP Toolkit Pro is totally free for contributors. I've just enabled that for the email from your git commit - just click 'Get Pro' then 'Log into existing account' and enter your j****.b**** gmail address to get started.

@julio-b
Copy link
Contributor Author

julio-b commented Jun 21, 2024

Obviously this is a bug (good find, thanks!) but interestingly this does work on my Android test device, and even on my local linux machine - it just changes the folder to be owned by uid 700, even if an actual user with that id doesn't exist. Curious!

Out of interest, what device are you using where this fails?

I was not able to reproduce on my physical devices either, only on emulator.
I am using a pretty old image Android 7.1.1 (Nougat), Android TV Intel x86 Atom System Image, API Level 25, Revision 16 which ships with:

$ toybox --version
0.7.0-ee023b2c4ae9-android

My guess is that this chown 700 command triggered an extremely rare bug in toybox that was fixed by this commit https://android.googlesource.com/platform/external/toybox/+/3d64b0cc95c5957e53474c3e50f143c61a057104%5E%21/

Anyway, thanks for fixing this, I'll put out a release to resolve that for everybody shortly.

Just in case you're not aware, HTTP Toolkit Pro is totally free for contributors. I've just enabled that for the email from your git commit - just click 'Get Pro' then 'Log into existing account' and enter your j****.b**** gmail address to get started.

I was not aware of this, thank you very much! HTTPToolkit is one of my favorite debugging tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants