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

Updated method of getting localKey #25

Closed
dansimau opened this issue Dec 28, 2021 · 5 comments
Closed

Updated method of getting localKey #25

dansimau opened this issue Dec 28, 2021 · 5 comments

Comments

@dansimau
Copy link

I just purchased a Robovac G30 Edge and got it running in Homebridge using this plugin. However, it was a bit of challenge. The instructions in the README did not work for me, as BlueStacks doesn't run on M1 and EufyHome 2.3.2 is no longer supported for my device.

What did not work:

  • I am on an M1 (arm64) Mac and BlueStacks is not supported on arm
    • Instead I used Android Studio to run an Android emulator and install the EufyHome APK
  • EufyHome 2.3.2 does not work at all with my device. It gives me a message that the app is outdated and I need to update to use it with the Robovac.
  • The patched EufyHome 2.4.0 APK (from these instructions) also did not work. As described by @lvcabral here, my device shows up but appears as "offline".
  • As such, the script being worked on in Discover local key from Eufy login details mitchellrj/eufy_robovac#1 also does not work, I get the error: The length of the provided data is not a multiple of the block length (as described here)

What did work:

What worked for me was to spy on traffic on the latest version of the EufyHome app. One of the API responses has the device ID and localKey.

Instructions for macOS arm64:

  • Install Android Studio, start Android emulator
  • Install Android platform tools (brew install android-platform-tools)
  • Download the latest EufyHome APK from here and install it on the emulator (adb install -r ./com.eufylife.smarthome_2021-11-25.apk) (note: I had to increase the free space allocated to the emulator, see https://stackoverflow.com/a/35828035/417083)
  • Install mitmproxy (instructions here)
  • Bypass certificate pinning using Frida (instructions here)
    • Follow all the steps in there, but on the last step, close the app in the emulator, then launch it again using: frida --no-pause -U -l ./frida-script.js -f com.eufylife.smarthome
  • Log in on the EufyHome app with mitmproxy running
  • Inspect responses in mitmproxy, one of them will have the localKey

Hope this is useful for someone.

@familyofharris
Copy link

hi i tried but i dont know what I'm doing with android studio?? can you help me to get it working please ? thanks steve

@lvcabral
Copy link

I have managed to use the old method (using the 2.4.0 APK) by creating a new account (and pairing the robot) using the old app, I suspect the creation of an account using newer apps is using a different type of ID and switching something on the backend that the old app (2.4.0) does not recognize. I created a new account with a different e-mail and it showed the local key. After that I managed to login on my iPhone with the latest app and it works. So I do recommend to keep the old app on an android device or VM.

@martijnpoppen
Copy link
Contributor

martijnpoppen commented Jan 20, 2022

@dansimau I use a similar approach to get the localKeys. but instead of mitmproxy I use fridump.
With fridump you can dump all frida data and it will have the localKey in it.

link: https://github.com/Nightbringer21/fridump

terminal tab 1:

frida --no-pause -U -l ./frida-script.js -f com.eufylife.smarthome

terminal tab 2:

python fridump.py  -U -s com.eufylife.smarthome

cd dump

strings * | grep <insert device id>

This method also works for the new X8 robovac

@apexad
Copy link
Owner

apexad commented Feb 11, 2022

looking to work on #14 soon so this issue is not important anymore.

@apexad apexad closed this as completed Feb 11, 2022
@lkucera
Copy link

lkucera commented Apr 23, 2023

I have managed to use the old method (using the 2.4.0 APK) by creating a new account (and pairing the robot) using the old app, I suspect the creation of an account using newer apps is using a different type of ID and switching something on the backend that the old app (2.4.0) does not recognize. I created a new account with a different e-mail and it showed the local key. After that I managed to login on my iPhone with the latest app and it works. So I do recommend to keep the old app on an android device or VM.

unfortunately this doesn't work with some vacuum, the old App will simply not find them...

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

6 participants