Writing a Python library and Android app for the I-Pace. Need help.

All Jaguar I-Pace related discussions
Post Reply
ardevd
Posts: 517
Joined: Mon Dec 24, 2018 12:30 am
Location: Norway

Writing a Python library and Android app for the I-Pace. Need help.

Post by ardevd » Wed Dec 26, 2018 9:14 pm

I won't get my I-Pace for another 4 months, at least. In the meantime, I really want to write a Python library to let me control my I-Pace and integrate it with other smart home technologies. I also don't like the official remote app at all and want to develop my own. I've reversed the Android app and managed to pick a part small parts of the API it uses but it's hard when I don't have an actual vehicle to test with. I've figured out most of the API requests but I have no idea what the server responds with.

Have anyone looked into this or would anyone be willing to either lend me account access or perhaps use Burp with a proxy to log all the HTTP requests for the various functions? Or, perhaps, easier, just install Postman and run some HTTP requests for me and send me the data returned by the server.
Control your I-Pace with jlrpy | I-PACE HSE Ebny Prem Txt MY2019.

Telematics: N/A | InControl: S19A_19.11.4-330884


johnd
Posts: 241
Joined: Sat Mar 03, 2018 8:47 pm
Location: Cambridge, UK

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by johnd » Wed Dec 26, 2018 9:34 pm

Is this really likely to be feasible? I'd have guessed (or at least hoped) that some fairly heavy-duty authentication was being used between app and car. Otherwise hackers could get up to all sorts of mischief.


ardevd
Posts: 517
Joined: Mon Dec 24, 2018 12:30 am
Location: Norway

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by ardevd » Wed Dec 26, 2018 9:51 pm

johnd wrote:
Wed Dec 26, 2018 9:34 pm
Is this really likely to be feasible? I'd have guessed (or at least hoped) that some fairly heavy-duty authentication was being used between app and car. Otherwise hackers could get up to all sorts of mischief.
It's beyond feasible. It's trival. Authentication is simple. You pass username and password and get an access token in return that you pass along with any subsequent request. As long as the token is valid you are considered authenticated and can control the vehicle. Once the token expires you have to request a new one. I have authentication nailed down but again, since I don't have any vehicles it's very time consuming to reverse the protocol. It's just JSON so it's not complicated but it saves me a ton of time if someone could just run the requests and pass me the data.
Control your I-Pace with jlrpy | I-PACE HSE Ebny Prem Txt MY2019.

Telematics: N/A | InControl: S19A_19.11.4-330884


ardevd
Posts: 517
Joined: Mon Dec 24, 2018 12:30 am
Location: Norway

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by ardevd » Wed Dec 26, 2018 9:57 pm

So far, it looks to be a fairly standard and secure API. The only thing that's a bit odd is the fact that they use a hardcoded basic auth password when requesting the user token. Makes little sense but was trivial to bypass since the password was there in plaintext in the decompiled Android app.

Actually, the API is a bit ugly. They duplicate values in custom headers as well as in the JSON body which is ridiculous. Doesnt matter much.
Control your I-Pace with jlrpy | I-PACE HSE Ebny Prem Txt MY2019.

Telematics: N/A | InControl: S19A_19.11.4-330884


DaveR
Posts: 143
Joined: Wed Oct 03, 2018 8:44 pm
Location: England

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by DaveR » Wed Dec 26, 2018 11:00 pm

Interesting project. Won't have my Ipace untill March so can't help but will follow this thread with interest.
MY19 UK Spec HSE + Options
FW In control S19A_19.07.02-312706 & 14.2 telematics
Corris Grey, Black Pack, Cold Clmt Pack, Front Fogs, Spare wheel, Pan Roof, Air Susp
Build Date: 04/03/2019


bjohnson
Posts: 2
Joined: Tue Nov 13, 2018 4:56 pm
Location: Denver, Colorado

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by bjohnson » Thu Dec 27, 2018 12:07 am

Getting my ipace next week, Jan 5. Big Arduino fan and home hacker, kid runs his his own hack club. I think it's a great idea. Would love to help out with this project when I get the car in a week. Will post here and message you when I get the car.


User avatar
Thincat
Posts: 288
Joined: Thu Feb 22, 2018 1:20 pm
Location: Leicestershire, UK

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by Thincat » Thu Dec 27, 2018 1:38 am

A very interesting project; can you give us some idea of the things you will be able to control? For example will you be able to implement features that have not been enabled because we haven't paid for them? An example might be the decent control feature or Adaptive Dynamics? How about being able to customise the display so that for example you could show detailed economy information in the left panel of the screen in front of the driver? or even put that sort of info on the HUD? Perhaps less ambitious would be to change the 'fuel gauge display' from the traditional petrol gauge to a % left. How about getting the camera images recorded onto a memory stick as a dashcam? I would certainly pay for an app that does that!
But before handing over the 'key' to my car I'd want to be sure that you are not planning to take control of hundreds of I-Paces and are actually up to no good!
Cesium Blue HSE no sunroof, air suspension, HUD. Changed 20in wheels to 18in :D .


ardevd
Posts: 517
Joined: Mon Dec 24, 2018 12:30 am
Location: Norway

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by ardevd » Thu Dec 27, 2018 6:29 am

Thincat wrote:
Thu Dec 27, 2018 1:38 am
A very interesting project; can you give us some idea of the things you will be able to control? For example will you be able to implement features that have not been enabled because we haven't paid for them? An example might be the decent control feature or Adaptive Dynamics? How about being able to customise the display so that for example you could show detailed economy information in the left panel of the screen in front of the driver? or even put that sort of info on the HUD? Perhaps less ambitious would be to change the 'fuel gauge display' from the traditional petrol gauge to a % left. How about getting the camera images recorded onto a memory stick as a dashcam? I would certainly pay for an app that does that!
But before handing over the 'key' to my car I'd want to be sure that you are not planning to take control of hundreds of I-Paces and are actually up to no good!
Hehe, I'm not talking about hacking the car. I'm simply talking about interacting with the vehicle similarly to what the remote app does. There might be features not implemented in the app yet that could be available through the API and it's possible that the API exposes information about the vehicle not shown in the app too. But without a vehicle I cannot know :)

What I'm talking about is the ability to control climate, charging, etc from a Python script. Then you could easily automate most vehicle controls :)
Control your I-Pace with jlrpy | I-PACE HSE Ebny Prem Txt MY2019.

Telematics: N/A | InControl: S19A_19.11.4-330884


Snoerd
Posts: 274
Joined: Mon Jul 16, 2018 9:41 pm
Location: Netherlands

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by Snoerd » Thu Dec 27, 2018 7:46 am

Maybe the first step could be calling the API via WebHook? Then I could easily integrate it in Google home via IFTTT. Like "Hey Google, preheat my car at 22 degrees." Or "Hey Google, What is the current state of charge?".
--
Jaguar I-Pace S, Order date July 16, 2018
Fuji White, Tow Bar, expected build date Nov 9, expected date at dealer Nov 23, expected delivery Nov 28. Arrived at dealer Dec 17 for delivery Dec 21! :D


ardevd
Posts: 517
Joined: Mon Dec 24, 2018 12:30 am
Location: Norway

Re: Writing a Python library and Android app for the I-Pace. Need help.

Post by ardevd » Thu Dec 27, 2018 7:47 am

Snoerd wrote:
Thu Dec 27, 2018 7:46 am
Maybe the first step could be calling the API via WebHook? Then I could easily integrate it in Google home via IFTTT. Like "Hey Google, preheat my car at 22 degrees." Or "Hey Google, What is the current state of charge?".
My thought exactly! But again, I need able and willing testers :)
Control your I-Pace with jlrpy | I-PACE HSE Ebny Prem Txt MY2019.

Telematics: N/A | InControl: S19A_19.11.4-330884


Post Reply

Return to “Main Jaguar I-Pace chat”