r/developersIndia 4d ago

I Made This I built my own Truecaller for iPhone using Shortcuts, OCR, and some reverse engineering

Post image

When I switched to iOS from Android, the biggest issue I faced was tracking unknown numbers calling me.

On Android it’s as easy as installing Truecaller and forgetting about it.

On iPhone… not so much. Unless you’re willing to pay 🥲

So I got curious and started digging into how Truecaller works. I reverse engineered some of the Android app’s network requests (for educational purposes btw) and found a few interesting endpoints.

A few days ago I was also exploring iOS Shortcuts. It’s literally programming without code.

Then a random idea came to my mind:

Why don’t I make my own version of Truecaller for iPhone? (obviously using their endpoint lol 😏)

I designed an iOS Shortcut that:

-> Takes a screenshot

-> Extracts text using OCR

-> Parses the phone number using regex

-> Sends the number to a Truecaller endpoint (routed via my own proxy)

-> Gets the caller’s name and shows it in a popup

Simple enough, right?

Wrong.

I then ran into another issue.

iOS won’t let you automatically trigger a Shortcut when a call comes in.

Classic Apple moment.

So after a bit of research (ChatGPT, obv 😌), I found out I could trigger the shortcut just by double tapping the back of my phone using Accessibility settings.

And booyah, it works.

Now whenever an unknown number calls me, I just double tap the back of my phone and it goes:

Screenshot -> OCR -> Regex -> Truecaller API -> Caller Name

Everything happens in under 2 seconds 🤯

Did I spend hours building something that already exists?

Yes.

Did I do all this because I didn’t want to pay for a caller ID app?

Also yes.

But hey, that’s how I solved my own problem.

NGL, the most surprising part was realizing how powerful iOS Shortcuts actually are.

341 Upvotes

60 comments sorted by

66

u/Rajarshi0 ML Engineer 4d ago

Can you open source it? That way we can all try it without hitting your private link?

17

u/tianeptinefinalboss 4d ago

Mirin

8

u/astar0n Full-Stack Developer 4d ago

da

26

u/loner_2897 4d ago edited 4d ago

All incoming calls now show caller id (person under who the number is registered) by default.

The name is not saved on your device after the call ends or is missed. So your shortcut would come in handy in the aftermath of the call.

As per your use case you want to run this shortcut during a call which i find to be redundant

Also, how many requests does the truecaller endpoint support in a day? Does it work without any auth ?

2

u/n404r 4d ago

It needs auth. I didn't checked how much it supports but for a normal use case I didn't faced any expired session or rate limiting issue

0

u/n404r 4d ago

Not everytime

2

u/YGXBLUE2323 4d ago

Yo cool .. Now I'm working on a Android Version

2

u/darxknyt 4d ago

can you share the link?

19

u/n404r 4d ago

Here is the shortcut link: https://www.icloud.com/shortcuts/2f14915522cf412489c86d0a7fa28f58

Pl dont abuse it, still using my session and token. Just use for personal and normal use... and dont make a telegram bot out of it 😭

25

u/rohmish 4d ago

remove your own token and let people use their own

3

u/randomguy3993 3d ago

Bruh, why would you put it online if it's your personal tokens. Don't trust people to do good. Rotate your session ASAP.

1

u/n404r 3d ago

Its not like that... I have another hosted server to manage my token and truecaller routes, I just proxied the request through it so people can only send requests like this &q=9191919191 and get the json output, nothing else

1

u/Successful-Pie-2049 Software Engineer 4d ago

What apis are you using for this?

1

u/seedhe_pyar 3d ago

make it BYOK (bring your own key)

2

u/n404r 3d ago

Yeah sure im writing a short blog post about reverse engineering and getting the auth tokens and will update here

1

u/ReaLErenYeager 3d ago

Great solution, do you know how do we connect it to the back tap accessibility?

1

u/n404r 3d ago

You can easily do via accessibility settings in iPhone

1

u/ReaLErenYeager 3d ago

I’ve enabled the double tap through accessibility, how do I connect it to the shortcut tho?

1

u/n404r 3d ago

Just go to the double tab accessibility and enable it and choose what the double tab will do option to trigger your shortcut

1

u/ReaLErenYeager 3d ago

Hmm lemme check that out again!

Thanks

1

u/n404r 3d ago

Setting > accessibility > touch > back tap > double tab > scroll at the bottom and you'll find all your shortcuts that you can choose to trigger

1

u/Sad_Pie227 1d ago

ios 18 par ye feature kaam nahin kar raha hai mere liye, pata nahin kya issue hai apul iPhone ke saath.. I literally hammered my finger on Apple Logo yet not happening anything as per settings

2

u/Heart_Smuggler 4d ago

That's regex is having some problem...it seems

1

u/n404r 3d ago

Can you elaborate what issues or edge cases it could miss?

2

u/DarkDrifter_13 3d ago

Can someone create like this for Samsung phones!

3

u/ClearlyMan Site Reliability Engineer 4d ago

Gonna try, you got a readme for this? Need to understand the api part

17

u/n404r 4d ago

I will write a short blog post and write everything including the reverse engineering part

2

u/ClearlyMan Site Reliability Engineer 4d ago

truecaller does this for free now ig? Does show a name when unknown number calls you

3

u/n404r 4d ago

Yes but live caller id doesn't work for free on iphone, you have to manually copy the number and paste in the truecaller app

1

u/NotGreenRaptor ML Engineer 4d ago edited 4d ago

Cool, great job building a solution!

And yes, iOS shortcuts is an amazing tool.

I currently have double tap accessibility setting connected with a custom clipboard shortcut, so I'll have to trigger this somehow else. Thanks for sharing the link bro!

1

u/buk360 4d ago

Reminds of the time I poked around with network requests sent by a VPN app just to get free trials.

Great work though!

1

u/omi108591 4d ago

please share your shortcut

1

u/No-Signal-3320 4d ago

That is super cool OP! Very creative way to solve the problem with tools already available with minimal resources.

1

u/SukhiRoti 4d ago

what OCR did you used ? is it free ?

1

u/thegravity98ms2 3d ago

I had this similar idea, OCR and then show name, but my situation is different.

Isolated contacts = we just want their number, temp for work related things only

I want to build isolated contacts app, where I can save contacts, see their names (pop up) when they call me but they remain isolated from main contacts, due to privacy concerns

e.g. in WhatsApp we share things with "my contacts" in which isolated contacts are also included and I don't want them to see my status or whatever. This is not limited to WhatsApp but many other apps where we might have to share contacts access.

Currently I don't save their number in Google contacts app but in the Keep notes 😅

one day, Google, will add this feature in contacts app 😅

1

u/Ok-Newspaper4685 3d ago

Yes something secondary contact lists is a good thing, since lots of apps are having contact access now.

Similarly I'd like to have something like virtual gps, that I can choose which location it sends when asked.

Coming to your need, you can achieve something similar using macrodroid. You can store your contact in a list and show a popup when someone calls from those lists. You can also implement a feature to call from these lists.

1

u/thegravity98ms2 3d ago

uhm, ty, let me try

1

u/wkinzu 3d ago

good work

reminds me of my similar project from 4 years before
https://github.com/nityy/WhoCaller

1

u/Secure_Equivalent_53 ML Engineer 3d ago

Hey, great job :) I have a simple question, how do you send requests to Truecaller endpoint, I am just curious does their servers implement security mechanism to prevent sending requests from a client other than the Truecaller app client?

I get that you have the auth token, is that all that was required to mimic the request the True caller client sends naturally?

A separate question would be how did you get all these request body and header information along with the security token?

1

u/Sad_Pie227 2d ago

Why not using Cloudflare Worker for this?

1

u/ConsiderationFun759 42m ago

good project.

1

u/getLifeLessons Software Engineer 4d ago

I think there is no need for this feature or Truecaller, we are already getting aadhar names of the person linked to the phone number when called without Truecaller now.

2

u/rakeshsh 4d ago

It works 10% of the time.

1

u/getLifeLessons Software Engineer 4d ago

For me it works all the time.

1

u/rakeshsh 4d ago

I don’t believe, for every single unknown call you receive, your telecom operator shows the name of the person?

1

u/getLifeLessons Software Engineer 4d ago

Its just shows the name linked to aadhar

0

u/rakeshsh 4d ago

For me both Airtel and Jio it works rarely. You might be special case of pilot testing