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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompiled sources #6

Open
ppietak opened this issue May 4, 2021 · 10 comments
Open

Decompiled sources #6

ppietak opened this issue May 4, 2021 · 10 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@ppietak
Copy link

ppietak commented May 4, 2021

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
Copy link
Owner

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.

@harrylepotter harrylepotter added documentation Improvements or additions to documentation question Further information is requested labels May 4, 2021
@ppietak
Copy link
Author

ppietak commented May 5, 2021

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
Copy link

evy0311 commented Jun 22, 2021

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

@ppietak
Copy link
Author

ppietak commented Jun 27, 2021

@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
Copy link

evy0311 commented Jun 27, 2021

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

@evy0311
Copy link

evy0311 commented Jun 29, 2021

@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
Copy link

evy0311 commented Jun 30, 2021

@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
Copy link
Author

ppietak commented Jun 30, 2021

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

  • I'm using framebuffer directly, which should simply draw pixels on a configured/chosen display, cause it seemed to be the fastest option
  • before that, H.264 needs to be converted to "rgb565le" buffer, and it happens with ffmpeg

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
Copy link

evy0311 commented Jun 30, 2021

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
Copy link
Author

ppietak commented Apr 27, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants