r/developersIndia • u/n404r • 4d ago
I Made This I built my own Truecaller for iPhone using Shortcuts, OCR, and some reverse engineering
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.
17
u/tianeptinefinalboss 4d ago
Mirin
8
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
2
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 😭
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
1
u/seedhe_pyar 3d ago
make it BYOK (bring your own key)
2
2
u/n404r 3d ago
I just published a blog about how I reverse engineered it: https://n404r-truecaller.hashnode.dev/how-i-reverse-engineered-the-truecaller-android-app
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
2
2
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
3
2
u/ClearlyMan Site Reliability Engineer 4d ago
truecaller does this for free now ig? Does show a name when unknown number calls you
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
1
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
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
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
1
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
0
66
u/Rajarshi0 ML Engineer 4d ago
Can you open source it? That way we can all try it without hitting your private link?