

Show HN: ShotBlocker - iOS screenshot detector a la Snapchat/Poke - 10char
https://github.com/clayallsopp/ShotBlocker

======
newishuser
What about when people need to take a screen shot of something sent to them
for evidence of a crime committed against them?

Also this all hearkens back to the "How do I prevent right clicking on my
website with jQuery?" days.

------
gallamine
I think the (semi) hidden subtext of both of the applications is the sending
of naked pictures or "sexting". I read through the reviews of Snapchat in the
app store and it's pretty clear. That may clarify the desire for knowing when
a screen cap has been grabbed.

~~~
geofft
This is also useful for the generalized digital-restrictions-management
problem, such as sending someone confidential documents and making sure they
don't copy it and send it elsewhere. (Well, insofar as anything is actually
useful for DRM, but you can do a reasonably good job on a non-jailbroken
platform with iOS's security properties.)

------
ConstantineXVI
If you're trying to block screenshots, AirPlay mirroring is something else
you'll likely want to watch for. It's possible to send a separate feed to the
AirPlay display; but not an iOS dev myself so I can't speak to how difficult
this is to do.

On the Android side there's also DDMS; unsure if this is detectable or not.

------
JoeCortopassi
Just out of curiosity, has anyone tried having a set of rapidly switching
masks to prevent screenshots, so that at any single point of time, all the app
can make a screenshot of is a few semi-random (but small) portions of the
image? Get it up past 60 frames per second, with something like a noise
pattern on the masks, and a screenshot may be pretty indistinguishable, while
giving the image only slightly less quality for the end user.

Would require quite a bit of tweaking to get just right, but there is clearly
a demand

~~~
alexkus
What, something like this (temporal dithering)?

<https://news.ycombinator.com/item?id=4955639>

~~~
JoeCortopassi
similar, but with better syncing between frames to eliminate the stroboscopic
effect that causes the mask to flutter too long randomly. Something has to
smooth the mask switching based on delta time so that slowing of the
processing doesn't cause overlaps.

But conceptually, yeah, thats what I was talking about. Interesting read,
thank you

------
jrockway
Is Apple approving spyware applications now? Is it the app's business what
core OS functionality you're using behind its back?

~~~
jonknee
I assume this won't last long, much like how the address book got locked down
after it was demonstrated to being abused.

------
jstanley
I'm not an iOS user, but what is to stop the user from taking a screenshot and
storing it somewhere else? Or posting it to a remote server?

Since the image on the screen is in video memory on the device, surely it is
impossible to prevent screenshots from being taken?

~~~
10char
Yup, it's impossible to prevent or delete screenshots before they're taken
(and you could also do something like take a photo of the device with another
camera, if you really wanted). Screenshots are always saved to the Camera Roll
on iOS, though, and they can't be taken with or redirected to another location
immediately.

Apps like Snapchat and Poke use a detection mechanism just for a better UX, to
alert other users after a screenshot happens.

~~~
eddieroger
I'm not sure it's impossible, but it would take a great amount of timing and
probably some luck. If you can detect a screenshot and throw up a new view
quick enough, that's what the screenshot would be. But, I haven't tested that
theory, and the timing is probably way too tight to actually work. It'd be
more like how Netflix throws up the red screen as soon as it leaves
foreground, or the WiFi list in Settings disappears.

------
oulipo
Would it not be so much easier to simply show images with some steganographic
message ("I was displayed in SnapChat") in it, and just check for this rather
than checking for "Screenshot-looking" pics?

Just sayin'

~~~
skymt
"Screenshot-looking" appears to mean "the same size as the screen."
Stenography would be significantly more complex.

[https://github.com/clayallsopp/ShotBlocker/blob/master/ShotB...](https://github.com/clayallsopp/ShotBlocker/blob/master/ShotBlocker/ShotBlocker.m#L165)

------
bbq
It seems like these things would be easy to get around by opening the message,
disconnecting from the Internet, snapping a screenshot, and installing the
app. Sure, a PITA, but digital is forever.

------
klapinat0r
Can someone elaborate on why this is an issue? Why would you need to block
screenshots of your app?

~~~
thomasvendetta
With apps like Facebook Poke or SnapChat the content you're sending is
ephemeral (it won't be around forever).

Developers of these types of apps can't necessarily prevent a screenshot from
happening but you they can at least notify the user who sent the content that
a screenshot was taken, which in turn lets them know not to trust the
receiver.

~~~
npsimons
_they can at least notify the user who sent the content that a screenshot was
taken, which in turn lets them know not to trust the receiver._

Why, because they are being held accountable for something they said?

~~~
golden_apples
It's not issue of being held accountable for something they said:

[http://www.vice.com/en_ca/read/cowards-are-blackmailing-
youn...](http://www.vice.com/en_ca/read/cowards-are-blackmailing-young-women-
to-death-on-the-internet-0000556-v19n12)

Its an issue of protecting users who are using apps like these believing their
privacy is safeguarded.

Whether this problem can be fixed with a technological solution, rather than a
more dramatic social change, is doubtful, but since the can of worms has been
opened, its worth trying.

~~~
npsimons
I don't deny there are issues, but they are societal/educational ones. People
need to learn that when you send someone something, that's it, it's out of the
bag, even if you trust that person. Due to backdoors, security holes and just
general warrantless wiretapping, there's almost no way you can guarantee that
what you send won't be snooped by a third party, sooner or later. Add to that
that people are far too trusting, and society is sick (between treating sex
and nakedness as "dirty" and misogynistic predators like the ones mentioned in
your link), and yes there will be problems. But things like ShotBlocker won't
solve the problem, it will only exacerbate the already tenuous control people
have over their property (what right does anyone have telling people they
can't make screen caps on their hardware?).

No, it's not worth trying, because a) it won't work, and b) it will have
unintended consequences.

------
jc4p
I'm pretty sure Snapchat actually does this by just checking to see if you hit
the shortcut for taking a screenshot (home button + power button)

~~~
prezjordan
I do not believe the iOS SDK has access to these buttons. As other users have
pointed out, screenshot detection is a hacky method of checking if touch
interaction is temporarily disabled (which only(?) occurs during a
screenshot).

~~~
wattson12
iOS gives no access to these buttons. It looks as though this code just polls
the photo library and checks if a new photo was created.

There was a different version going around earlier which checked for touches
being disabled, which happens during a screenshot (but this not the only time
iOS does this, I know it happens during the standard navigation "push"
animation, and wouldn't be surprised if there were quite a few other standard
system actions which disable touches)

------
mikeash
Seems misleading to call this "ShotBlocker" when it doesn't actually block
anything.

------
uptown
While this may be nice - it's only a partial solution. Anybody can take a
photo of screen from device #1 with camera from device #2. Nothing can prevent
that.

------
plasma
Nothing would stop a second phone with its camera recording the footage of the
first camera.

