Skip to content

Instantly share code, notes, and snippets.

@uvNikita
Created October 25, 2021 12:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uvNikita/f9dbbc09cdd71cbcac3a24beac62f355 to your computer and use it in GitHub Desktop.
Save uvNikita/f9dbbc09cdd71cbcac3a24beac62f355 to your computer and use it in GitHub Desktop.
Roomba J7 and Home Assistant

Patch irobot apk using apk-mitm

  1. Enable USB debugging on the phone

  2. Enable adb on PC

  3. Connect phone to PC via USB

  4. Pull roomba apks from the phone

    $ adb devices
    List of devices attached
    RF8M81QSMMJ	device
    
    $ adb shell pm list packages
    ...
    
    $ adb shell pm path com.irobot.home
    package:/data/app/.../base.apk
    package:/data/app/.../split_config.arm64_v8a.apk
    package:/data/app/.../split_config.xxhdpi.apk
    
    $ adb pull /data/app/.../base.apk com.irobot.home.apk
    $ adb pull /data/app/.../split_config.arm64_v8a.apk config.arm64_v8a.apk
    $ adb pull /data/app/.../split_config.xxhdpi.apk config.xxhdpi.apk
  5. Download xapk from https://apkpure.com/irobot-home/com.irobot.home, extract files into irobot-xapk folder

  6. Copy manifest.json

    $ cp irobot-xapk/manifest.json manifest.json
  7. Create new xapk

    $ apack irobot.zip com.irobot.home.apk config.arm64_v8a.apk config.xxhdpi.apk manifest.json
    $ mv irobot.zip irobot.xapk
  8. Patch irobot.xapk with apk-mitm

    $ apk-mitm irobot.xapk
  9. Extract patched apks from xapk

    $ aunpack irobot-patched.xapk
  10. Uninstall irobot application from the phone

    adb uninstall com.irobot.home
  11. Install apks with install-multiple

    $ adb install-multiple com.irobot.home.apk config.arm64_v8a.apk config.xxhdpi.apk

Use mitmproxy to get BLID and password

  1. Install and run mitmproxy

    $ mitmproxy
  2. Open port 8080

    $ sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
  3. Follow instuctions to configure proxy on the phone with installed CA: https://medium.com/testvagrant/intercept-ios-android-network-calls-using-mitmproxy-4d3c94831f62

  4. Run irobot application, login

  5. Select request to /v2/login in mitmproxy: check robots dict in response, BLID is entry's key and password is in the password field

@Daniel-dev22
Copy link

I am stuck on step 7. Also where do you get apk-mitm from?

image

@uvNikita
Copy link
Author

@Danny2100 apack is just a linux tool to create archives. You can use any other tool that can create irobot.zip archive with 4 files in it: com.irobot.home.apk, config.arm64_v8a.apk, config.xxhdpi.apk and manifest.json

apk-mitm is a tool from here: https://github.com/shroudedcode/apk-mitm. Not sure how to install it on Windows though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment