harrylepotter / carplay-receiver

Linux carplay receiver - intended for non-touchscreen OEM projects
MIT License
259 stars 35 forks source link

Decompiled sources #6

Open ppietak opened 3 years ago

ppietak commented 3 years ago

Hello, @harrylepotter It's nice to see continuation of electric-monk/pycarplay (which is great I think, by the way). Good work 👍

I've encountered this Gist, and I wonder where this come from? I've only found "decompilable" versions without wireless connection, probably older ones. This one helped me with something (as I work on a node.js version of this receiver as a personal side-project), I wanted to thank you for sharing it. Maybe I could help with something as well, as I've got a bit familiar with this protocol, and took different approach with video/audio output streaming.

harrylepotter commented 3 years ago

Hey @ppietak thanks for your message. Stoked that someone is getting value from the project! For the gist shown, i essentially took the 'last known good version without malware' (found somehere on 4x4shop.ca - cant remember where) and ran it through an online Jad decompiler (http://www.javadecompilers.com/). It was then a matter of painstakingly looking at the decompiled output and cross-referencing/renaming symbols to something human readable, using @electric-monk's protocol.py as a reference of known parts of the protocol. I recall this taking the better part of a day to do over a thanksgiving weekend.

I seem to recall the 4x4shop.ca version of the .apk having support for the wireless connection, but i never really dug into it.

ppietak commented 3 years ago

Cool! didn't know this website, indeed their version nicely decompiles itself 👍

It was then a matter of painstakingly looking at the decompiled output and cross-referencing/renaming symbols to something human readable, using @electric-monk's protocol.py as a reference of known parts of the protocol

Yeah, did't the same thing for myself - but once it starts making sense, I find it quite interesting :)

Thank you for all information. I think I'll publish this node.js version too, but now I'm struggling a bit with sending a microphone input (it kinda worked for a moment, but usb connection "crashes" are still common, what I'm trying to avoid).

evy0311 commented 3 years ago

@ppietak did you ever get anywhere with your Node JS version?

ppietak commented 3 years ago

@evy0311 kind of, I've put it off for a while, cause I had no spare time for it. I remember my main struggle was to send audio into the dongle properly, as no matter how I've tried (with various sample rates, bit depth, data buffering, etc), after some time of recording it was causing connection errors. Other things work - receiving video, audio music+commands, wireless auto-connecting, mouse+keyboard mapping, although it may require some adjustments cause I didn't put any effort to make this setup easier for other people yet. And it may depend on a Raspberry Pi it's used on - initially I was developing it on RPI 3, but later I've reconfigured it for RPI 4.

https://github.com/ppietak/node-carplay

evy0311 commented 3 years ago

Awesome! I'll check it out here soon and see if I can mess around with it.

evy0311 commented 3 years ago

@ppietak Ive been playing around with your NodeJS version, and I can see everything happening in the console, but there is no video. This is on a RPi 4. Ideas?

evy0311 commented 3 years ago

@ppietak looking at it, do I need to implement something like mplayer or omxplayer to display the output from the frame buffer? Or should the application automatically have something pop up already that displays the CarPlay video?

ppietak commented 3 years ago

Probably I'd have to put my hands on it again, and check it, but

I think I'll need to get through the setup once again to remind myself what had to be done in order to make it work, but I can't give this a priority right now, so I can't tell when I'll be able to do that. I remember that I used to check if fbdev is working, by piping some static images (with "cat" or something) onto the /dev/fb0 - maybe this will help somehow.

evy0311 commented 3 years ago

Definitely helps! I'll be toying around with this later this week to see where I can get with it.

I know you have the touchscreen stuff implemented, did you have actual CarPlay video displaying on the screen with touchscreen inputs working? If so I can try to tackle this and get it going.

ppietak commented 2 years ago

Sorry for the delay, but yes - it worked on 7" Waveshare 1024x600 HDMI touchscreen. Without multi-touch (but I'm not sure if it's supported in CarPlay anyway).