I've been dealing with Hikvision camera apps not getting push notifications on GrapheneOS for over a year. I reluctantly ran LineageOS just to keep things working. Then, two days ago, everything Google-services-related went completely haywire on my phone after the TSA had it. That was the breaking point.
I revisited the issue out of pure frustration.
The Problem
Hikvision's apps check for the presence of com.google.android.gsf (Google Services Framework). If it's not there, they bail—even when GmsCore (Play Services) is installed and FCM is fully functional. Since GrapheneOS doesn't include GSF by default, the check always fails.
I reached out to GrapheneOS. They moved my thread to the 3rd-party-apps forum and locked it. I reached out to Hikvision/Annke. They never replied.
So I reversed the APK myself.
What I Did
I decompiled the app, traced the push notification registration logic, found the hardcoded GSF check, and built an MIT-licensed patcher that removes it.
The patcher takes your APK, strips the GSF check, and repackages it—leaving everything else intact. You can run it locally, it's open source, and it works today.
The Upstream Fix
I also submitted a PR to GrapheneOS that synthesizes a minimal GSF package presence when verified GmsCore is visible to the caller. It's gated—it only engages when Play Services is actually installed and visible.
If merged, this would fix the issue for every app that makes the same incorrect GSF check, not just Hikvision.
For Non-Devs (The "Stupid Easy" Method)
I documented a dead-simple approach:
- Enable USB debugging on your phone
- Plug it into your computer
- Tell an AI assistant (Cursor, Claude, etc.) to use the GitHub repo to patch your APK
That's it.
Links
- MIT-licensed patcher: https://github.com/Alex9001/hikvision-grapheneos-fcm-patch
- GrapheneOS PR: https://github.com/GrapheneOS/platform_frameworks_base/pull/432
- Full technical write-up: https://reflashlab.com/articles/graphene-vs-hikvision/
Why This Matters
This isn't just about Hikvision. There are likely dozens of apps making the same mistake—checking for GSF instead of verifying FCM viability. If the PR gets merged, all of them get fixed at the OS level.
Top comments (1)
Reverse engineering is most useful when it ends in a boring maintainable fix instead of just a clever teardown. The PR path is the important part here: it turns private debugging into something other GrapheneOS users can actually benefit from.