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

Auto-start adb with trusted keys #174

Open
Atemu opened this issue Mar 22, 2022 · 6 comments
Open

Auto-start adb with trusted keys #174

Atemu opened this issue Mar 22, 2022 · 6 comments

Comments

@Atemu
Copy link
Contributor

Atemu commented Mar 22, 2022

So this is a fairly specific problem I'm having but might have general usefulness.

I've got a friend's cheeseburger where the screen is almost entirely broken. Glass shattered, no image and only a portion of the screen registers touch.

Bootloader is unlocked though and I can control the device via adb, fastboot and/or twrp.

I plan to use this device as a guinea pig to test without risking breaking my daily driver.

However, I cannot trivially control android itself. I need adb to be enabled in order to use use scrcpy to do anything, including enabling adb.
This can be solved by enabling adb from the recovery: https://gist.github.com/niikoo/3f6bd13a69f2d68f3dd51cc667e79bdc (property step is unnecessary)

You basically need to set some system build.props and push your public key; akin to enabling ssh and pushing a trusted key.

Is it possible to bake these into the system image for simplicity?

@samueldr
Copy link
Contributor

I think using an eng build instead of userdebug might do this:

But I also believe LineageOS has slightly different semantics for userdebug than AOSP does. [citation needed].

@Atemu
Copy link
Contributor Author

Atemu commented Mar 22, 2022

Oh, we even have a variant option for that! I'll try that tomorrow.

I'd still kind of like to have a regular userdebug build but with adb running.

@zhaofengli
Copy link
Contributor

I do this to embed my adb vendor keys:

  product.extraConfig = ''
    # Uncomment as needed
    #PRODUCT_SYSTEM_PROPERTIES += persist.service.adb.enable=1
    #PRODUCT_SYSTEM_PROPERTIES += persist.service.debuggable=1
    #PRODUCT_SYSTEM_PROPERTIES += persist.sys.usb.config=mtp,adb
    PRODUCT_ADB_KEYS := ${./adbkey.pub}
  '';

@Atemu
Copy link
Contributor Author

Atemu commented Mar 23, 2022

Thanks a bunch @zhaofengli but unfortunately, that doesn't seem to work. My system's build.prop doesn't contain those proerties and adb isn't started.

@Atemu
Copy link
Contributor Author

Atemu commented Mar 23, 2022

Wait, shouldn't that go to system.extraConfig?

@Atemu
Copy link
Contributor Author

Atemu commented Mar 24, 2022

That doesn't work either. Any idea?

I'm using LineageOS, maybe that's why.

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

No branches or pull requests

3 participants