Automated vCard writer (with photo)

Yeah I’m properly impressed by the quality for a half kilobyte image.

I didn’t think cellphones read anything other than JPEG and GIF for contact photos. But then I remembered Android is Google, and WEBP is also Google. I figured it would make sense for them to have Android support it. So I tried, and sure enough… tada!

1 Like

This is super cool, I plan to create and upload one tonight :slight_smile:

I wish I was smart enough to turn this into an automated webpage app thing…

Thanks again!!!

1 Like

Just a couple notes;

From a fresh Kali Live, to compile, you also need:
apt-get install libpng-dev
apt-get install pkg-config

In your updated script, you forgot the " " around the phone number and the script spits out an error because of the ( ) around the area code.

Lastly, because I’m a noob, the max size of the output file can be 888 bytes. Make sure you adjust the WEBP section of the quality settings, not just the top one. That threw me off for a few mins :slight_smile:

Sorry, I’m getting an error when trying to open the vCard on my Pixel 2

Ooh, well spotted. That one’s on me: I replaced my personal phone number with a generic one in the script before pasting it here and I didn’t check that it would work. I used the first fake number that came to my mind, but I currently live in Finland and there are no parens in phone numbers here :slight_smile: Sorry about that.

That’s the maximum size of the NDEF (more like 868 bytes for a NTAG216 in fact, because there are bytes used by the NDEF encapsulation and other reserved fields in the tag). But the actual image in binary format is much smaller, because it needs to be base64-encoded. Typically in the order of 5.5 kB before encoding.

Yes sorry again, I guess that wasn’t too clear. There’s a top PHOTO_ENCODING variable that selects whether you want JPEG or WEBP, and then two distinct quality settings. If PHOTO_ENCODING is set to WEBP, only the WEBP_* variables do anything.

Hmm now that’s strange.

There are two things your phone could choke on: either the version of the vCard format - which I set at 2.1 - or the WEBP encoding of the image.

vCard v2.1 dates back to 1996, so it should be supported. I chose it because that’s the format that has the fewer mandatory fields, to save as much space as possible. Also, it’s a sort of lowest common denominator, to ensure it’s compatible with just about anything. You could try vCard v3.0, but then you need to add other fields like FN and ADR for full compatibility. See here: https://www.evenx.com/vcard-3-0-format-specification

WEBP is a Google format that was created in 2010. Being a Google format, it’s highly likely to be understood natively by all Android phones since 2010. Yours was made in 2017: it most definitely should understand it. I myself tried it on Android versions from 5 to 10 without any issues, and I shared my own vCard with many people without any issues either. Maybe try to transfer the .webp image as-is onto the phone’s filesystem and open it directly with the photo viewer: if it displays it, there should be no issue with the image in the vCard, since it’s the same code that handlies both.

I can send you a ready-made .ndef file that I know works for sure, that you could try to write into a tag and try on your phone if you want, just to make sure there isn’t something odd with the Pixel 2. I wouldn’t think there is - it is a Google phone after all - but who knows.

Also, are you using the stock Android contact app?

I wish all noobs were as competent as you :slight_smile:

And also because of the capability container nonsense not making full use of the memory for NFC… it’s honestly pretty fucked up.

The nonsense only applies to chips with more than 1k though doesn’t it? The NTAG216 isn’t really concerned by this.

Also, aren’t most DT implants magic? If it’s magic, it should work everywhere with the power of magic :slight_smile:

magic-confetti

Once again, noob here, but I don’t think many are ‘magic’ (sorry if that was sarcasm), especially the NeXT (which I assume is a top seller?). Something about the magic ones being physically larger.

Something I wish I would have known more about when I got the NeXT, but no biggie

Yes, I can view it just fine, and if it’s OVER 50x50px I can add it to a vCard (it wants to give you the option to crop it before adding it, but can’t edit under 50x50px), but if you try to export it from there, it shows the vCard as being like 2k or something (probably the vCard v3 or whatever?).

Yes, all stock Google Pixel 2, no branding

Well shucks :stuck_out_tongue:
Just trying to help document as much as possible for other future noobs.

Okay here’s a corrected version. I removed the confusing JPEG bit (it just does WEBP compression) and I made sure it works this time :slight_smile: I also left the intermediate files it produces and the final NDEF file, in case you want to compare what it does on your machine.

Naturally, I’ve tested it and it works: the tag is an NTAG216, and it works fine on my Android 5, 7, 9 and 10 test phones.

vcard_writer_with_sample_information.zip (333.7 KB)

Let me know how this works for you.

No… read the section called Memory problems

Not sarcasm. There are some DT implants with magic chips in the sense that they can be configured to change personality or they have backdoor commands. But all DT implants are magic because they were lovingly crafted by Amal and they bring you joy. Also, they automatically expose you to the DT worldwide mind control field and it’s great, and there are no…no…no…no…no…no…no…side…side…side…side…effecttttttttsttststtsttstt&"#¤&%/

Yep, that works perfect. No idea what’s going on. I’ll retry it a few more times and get back to you with my findings.

I haven’t done too much digging yet, and I’m just comparing the jpeg+webp script, not your new one, but there are some differences in my output compared to yours.

Yours:

Mine:

What’s your implant? How much space does the script say is available on the chip when you run it?

Hello fellow Oregon resident.

:slight_smile:

I’m really only running the script, moving the files to my phone, then testing to see if the vCard works. After I get one that works, I will then use TagWriter to write the ndef file to my NeXT.

In those two screen shots, I’m mainly talking about the base64…webp, yours doesn’t have that for some reason. Also all of the -en tags that mine does have.

I’m glad I’m not the only crazy one here :stuck_out_tongue:

Try using my sample thing, then change one piece of information at a time. That should tell you quickly what the contact app is choking on.

Also, remember that the final NDEF should be 868 bytes or less to fit on your NeXT. It might be fine now, but the script will complain when time comes to write it if it’s any larger.

I will try that soon.

Also, do you sleep??

Not much these days…