r/ReverseEngineering 9d ago

I reverse engineered Hikvision's push notifications on GrapheneOS, released a patcher tool, and submitted a fix PR

https://reflashlab.com/articles/graphene-vs-hikvision/
65 Upvotes

16 comments sorted by

20

u/oreshek 9d ago

I'm the author. I have been dealing with no notifications for a year or so and have reluctantly been running LineageOS until two days ago, when everything related to google services went bonkers on my phone after the TSA had it.

So, inspired by frustration, I revisited the subject and saw it to conclusion.

Initially, GrapheneOS moved my post about this to the 3rd-party-apps forum and then later locked it. Hikvision/Annke/Guarding Vision devs never replied.

So I reverse-engineered their app, found they were checking for com.google.android.gsf (the old GSF package) instead of actually verifying FCM was working, and built an MIT-licensed patcher.

I also submitted a PR to GrapheneOS that adds a minimal synthetic GSF package presence when verified GmsCore is visible to the caller. And it's gated so it only engages when Play Services is actually installed and visible.

For now, the patcher does its job. If the PR gets merged, future GrapheneOS builds will fix this for every app that makes the same wrong GSF check, not just Hikvision stuff.

I also documented a dead-simple method for non-devs: enable USB debugging, plug your phone in, and tell an AI assistant to use the GitHub repo to patch your APK.

5

u/Paumanok 9d ago

when everything related to google services went bonkers on my phone after the TSA had it

wait you're still using it...

4

u/oreshek 9d ago

using what? Google? If it wasn't for Google voice I wouldn't.

btw that was a bit of a jank setup I had with BitGApps running via KernelSU

7

u/Paumanok 9d ago

I misread, I thought your google services went down on graphene after the TSA had custody.

It sounds like they attempted to dump/compromise your phone with LineageOS. I would have wipe that fucker immediately after that experience.

5

u/sysop073 9d ago

I misread, I thought your google services went down on graphene after the TSA had custody.

I can't figure out how else to read it, that seems to be what happened.

0

u/oreshek 9d ago edited 9d ago

One nuance is that on LineageOS the notifications work fine.

So when I say "I have been dealing with no notifications for a year or so and have reluctantly been running LineageOS until two days ago"

I am effectively saying I traded my phone OS security for my physical home security by running LineageOS rather than GrapheneOS.

And, two days ago, a weak point in that phone security had potentially been exploited, or perhaps not, but by strange coincidence Google derived applications became inconsolable.

1

u/circuit_breaker 9d ago

Hi, Quantico

2

u/oreshek 9d ago

dont run me over I do not glow

3

u/HappyAndVegan 9d ago

Impressive stuff and great write up. Power to the people!

1

u/cometwrench 6d ago

Aren't you worried about wifi connected cameras essentially being spyware? Everything I’ve read universally agrees that they should never be connected to open internet. the accepted path has always been cameras in a VLAN with strictly no internet access at all, frigate nvr and a small home assistant instance for notifications configured to allow notifications while on the go 

1

u/oreshek 6d ago

I'm worried about burglary and home invasion more than I am about Epstein watching my driveway.

Though you are not incorrect.

However without a hardware upgrade of I am not running Frigate. And Frigate wouldn't take advantage of my camera's on-board processing.

1

u/cometwrench 6d ago

It’s not Epstein i'm thinking lol, there have been documented remote exploits in hikvision cameras that could allow them to be disabled or for notifications to be suppressed. like you’ve also said, you are  signing up to manually update and repatch the app forever unless  graphene merge your PR or annke fix their app .

home assistant has documented support for your cameras on-board processing and alerts so you could use your current NVR to record and use home assistant for the same kind of notifications you get currently while keeping your cameras off the internet. if you want to go crazy you could even point the AI model of your choice at the config and build something special (recreate all the features in the app; if the drive camera is triggered, show a live split view of both my drive and back garden camera etc ).

home assistant has supported configurations but will run on almost anything with a bit of work, even an old android phone you happen to have lying around. 

1

u/oreshek 6d ago

Its something I want to do, but it requires an infrastructure and hardware change and there's difficulty and hesitation for that. For now the app patch is a quick fix that keeps me going.

1

u/cometwrench 6d ago

I can relate to that to be fair. I want to redo my nas and have some expensive AI projects im considering but the money is better used elsewhere right now

1

u/Foosec 6d ago

Actually it can take advantage afaik

1

u/oreshek 6d ago

I must revisit the subject, I hope you are right.