Hyundai-Kia-Connect / kia_uvo

A Home Assistant HACS integration that supports Kia Connect(Uvo) and Hyundai Bluelink. The integration supports the EU, Canada and the USA.
MIT License
426 stars 85 forks source link

Support Korea region #701

Open Royental opened 1 year ago

Royental commented 1 year ago

Could you please make it can support Korean region? Ironically, your masterpiece cannot be used in Korea. Please let me know if there is any information I can provide for Korean region support.

Thank you!

cdnninja commented 1 year ago

Are you able to sniff the traffic for us?

Royental commented 1 year ago

Are you able to sniff the traffic for us?

Thank you for your interest. Any references to learn how to sniff traffic? I'll try.

I think that I can make pcap file with tPacketCapture via android app. What actions should I take once I activate the packet sniffer?

cdnninja commented 1 year ago

Charles proxy seems to work well if a mobile app. If a website debug mode works too.

cdnninja commented 1 year ago

Key is following the flow for urls and headers to understand how it works.

Then to try align that to one of our existing regions to see if it is the same. If so we can reuse work.

Royental commented 1 year ago

Key is following the flow for urls and headers to understand how it works.

Then to try align that to one of our existing regions to see if it is the same. If so we can reuse work.

Thank you cdnninja!

I'll let you know once I get the packets.

Royental commented 1 year ago

bluelink.chls.zip

I got the packets via Charles Proxy. I hope this data is helpful for support Korean region.

Please let me know if you need any additional information.

Thank you!

kjd2338 commented 1 year ago

Genesis_KR_Capture.zip I am adding Genesis KR Packets via Charles Proxy. I hope this data helps too.

Thank you~! ;)

cdnninja commented 1 year ago

Looks like SSL proxying wasn't enabled and configured so I can't see the contents of the stream. As a note once this is done it will contain items like your password.

This applies to both the Genesis and bluelink capture.

Royental commented 1 year ago

The desired outcome wasn't achieved, but thank you for your efforts. May good luck always be with you!

cdnninja commented 1 year ago

The desired outcome wasn't achieved, but thank you for your efforts.

May good luck always be with you!

Just to clarify this is something you need to enable and redo for me to watch the traffic.

Royental commented 1 year ago

Oh, It's not ended. I'll try it again. :)

Royental commented 1 year ago

Sonata the edge KR.chls.zip

I did it again. Please check with this.

Thank you!

cdnninja commented 1 year ago

Same thing:

image

It should show header tabs etc on each item.

SSL proxying in charles need to be turned on and the SSL cert installed into the android device.

Royental commented 1 year ago

I think that I have to SSL setting again. I'll update after I finished.

Royental commented 1 year ago

Same thing:

image

It should show header tabs etc on each item.

SSL proxying in charles need to be turned on and the SSL cert installed into the android device.

Sonata the edge.chls.zip

I found my problem on Charles proxy and fixed it. Could you please check this file?

Thank you!

cdnninja commented 1 year ago

It does look pretty similar to EU. This capture doesn't seem to contain the login flow though. Maybe email me a copy with that?

Royental commented 1 year ago

It does look pretty similar to EU.

It does look pretty similar to EU. This capture doesn't seem to contain the login flow though. Maybe email me a copy with that?

I've sent an email include packets.

Thank you!

cdnninja commented 1 year ago

So while the endpoints are roughly the same it looks like they don't use something called stamps like EU. This may be a good thing, but will take some time to adjust to confirm.

cdnninja commented 1 year ago

I have started a draft of the code here: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/pull/388

Currently it doesn't work, it gets a device ID no issue but after that fails with no authorization on the next part. I suspect headers and cookies need some work. I also noticed it has a ccsp-uuid that other regions don't have, it seems to change but not sure how to predict it.

corsair-kr commented 1 year ago

hello.

Is the control failing after login? Or are you having problems logging into your account?

cdnninja commented 1 year ago

No haven't made it to login just yet. It gets device id fine but after that fails with a 401 error code before it gets to login command. I haven't spent more time on it, feel free to give it a try based on the PR code I have linked.

nara1111 commented 5 months ago

Hello. It seems that in regions outside of Korea, this API was created through reverse engineering of iPhone and Android apps. However, in Korea, Hyundai Motor Group has put a lot of effort into telematics services and is officially providing API specifications. Of course, since it is not based on an app, it only provides a very limited level of information, such as driving distance status. But is there a way to use this?

cdnninja commented 5 months ago

Yes. With docs wouldn't be hard to do. Are you willing to do the dev if I guide you?

nara1111 commented 5 months ago

@cdnninja I'm currently trying this with claude.ai, and if you guide me, it would be a great help. In fact, I was working on this as a personal project to integrate it with HA, but the HA integration also ends up being based on this API, so I need to modify this API. By the way, I don't have much development knowledge, so I'm taking this slowly.

cdnninja commented 5 months ago

It would be a largely a single file for this integration to support it. With template to follow.