Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

simplymuzik3

macrumors 6502a
Original poster
Jan 29, 2009
589
0
Hi, I have a simple question. I have some anti-piracy code in my app, and I was wondering how I could force quit the app (if the app is pirated). Any help is appreciated! Thanks!
 

Troglodyte

macrumors member
Jul 2, 2009
92
0
I think there's a non public method in UIApplication called terminate. Not that you should be using non-public methods ;)

Wouldn't launching Safari and going to a webpage for this be nicer than just crashing the app? If you launch safari then your app will finish anyway and at least the user will know why.
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
I think apple broke the terminate selector in 3.0 I used to use it in a game I was developing and it stopped working after I upgraded to 3.0.

Forget the going to a web page lol, if people are using a pirated copy of my apps they see the attached screenshot :D (obviously we place the button on with code, hence why its not in the picture...)

We let them go through the main menu etc to give them a taste of the game if they were to buy it then as soon as they try to actually start a new game, bam that pops up. I'm actually tempted to ask them if they would like to accept push notifications the first time the app launches and if its a cracked version I will have a script hound them on a daily basis until the app is uninstalled. If its a legit version I will use push to notify of other (more friendly) stuff
 

Attachments

  • piratewarning copy.png
    piratewarning copy.png
    212.7 KB · Views: 124

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
I think apple broke the terminate selector in 3.0 I used to use it in a game I was developing and it stopped working after I upgraded to 3.0.

Sure, blame it on Apple when you use a private method and it stops working ;)

You could use class-dump on UIKit framework for the simulator to find out if it's been changed or renamed but otherwise you shouldn't use that method, or if you do use some checks (e.g. respondsToSelector) before calling it.
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
Sure, blame it on Apple when you use a private method and it stops working ;)

You could use class-dump on UIKit framework for the simulator to find out if it's been changed or renamed but otherwise you shouldn't use that method, or if you do use some checks (e.g. respondsToSelector) before calling it.

Oh here we go with the lectures... :p

I wasn't blaming anybody for anything, I was only using it for development purposes anyway as I'd never release a product that makes use of private methods, I was just stating it doesn't work anymore in response to Troglodytes post :rolleyes:

Besides I was doing the check using respondsToSelector anyway, hence why I believe Apple has changed it as it worked fine prior to the 3.0 upgrade.

I've found with using the exit() function it doesn't terminate your app nicely with the zoom out animation and fading out of sound etc, you are definitely always better off having the user quit the app with the home button than you are doing it programatically
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
from what i've read so far about pirating apps, the hackers search for strings (namely: @"SignerIdentity")... perhaps it would be more effective to produce this string by appending characters so it's less traceable?
 

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
from what i've read so far about pirating apps, the hackers search for strings (namely: @"SignerIdentity")... perhaps it would be more effective to produce this string by appending characters so it's less traceable?

Yeah that works, I've encoded mine in base 64 just to make it that little bit tougher for wannabe hackers. I'm only interested in stopping the less experienced crackers using dedicated cracking software (crackulous). As far as I'm concerned, if an experienced cracker decides to devote the time to crack my apps I'll already be rich and won't care much anyway. I doubt the top crackers waste their time on anything outside of the top 10 apps
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
i'm curious whether it's possible to search for comments in code. i mean, it would be unfortunate to safeguard a @"SignerIdentify" string with encoding only for it to be tagged with an obvious comment above the method. i know nothing about cracking.

keeping in line with the OPs discussion. since the ability to force quit an app may change (has changed?), i'd just toss up an image instead of adding the viewController.view during applicationDidFinishLaunching. besides, quitting an app for a cracker is more polite than presenting a static image which they'll have to exit from themselves. attached is what i use for my own apps. also, images are ideal to avoid using strings such as "This Application Has Been Pirated", which can be located.
 

Attachments

  • Picture 1.jpg
    Picture 1.jpg
    45.9 KB · Views: 66

mccannmarc

macrumors 6502
Aug 15, 2008
270
0
Manchester, UK
There's no way a cracker can see comments in code as they never actually make it to the final binary, they are useless as far as the program is concerned.

I don't get why you would want to be polite to a cracker, its not like they downloaded a cracked version of your app by accident. All this BS about try before you buy is a pathetic excuse. If you owned a shop and someone stole an item from it you would be straight on the phone to the cops, you wouldn't be nice to them in the hope that they would come back and buy the item from you once they decided they liked it.
 

Howardchief

macrumors regular
Jun 9, 2008
138
0
How to Force Quit an App

Press and hold the sleep/wake button as if you're turning the phone off.

When the "slide to power off" thing comes up, press and hold the home button until the app in the background shuts off.
 

sammich

macrumors 601
Sep 26, 2006
4,305
268
Sarcasmville.
I don't get why you would want to be polite to a cracker, its not like they downloaded a cracked version of your app by accident. All this BS about try before you buy is a pathetic excuse. If you owned a shop and someone stole an item from it you would be straight on the phone to the cops, you wouldn't be nice to them in the hope that they would come back and buy the item from you once they decided they liked it.

Yeah, but if you put aggressive language or profanity in then you'd have to publish your app under a higher age limit:p
 

simplymuzik3

macrumors 6502a
Original poster
Jan 29, 2009
589
0
i'm curious whether it's possible to search for comments in code. i mean, it would be unfortunate to safeguard a @"SignerIdentify" string with encoding only for it to be tagged with an obvious comment above the method. i know nothing about cracking.

keeping in line with the OPs discussion. since the ability to force quit an app may change (has changed?), i'd just toss up an image instead of adding the viewController.view during applicationDidFinishLaunching. besides, quitting an app for a cracker is more polite than presenting a static image which they'll have to exit from themselves. attached is what i use for my own apps. also, images are ideal to avoid using strings such as "This Application Has Been Pirated", which can be located.

Yeah, I just put an image instead. The image says "Stop Pirating this App" or something like that. You said dont use something like that, why not?
 

Darkroom

Guest
Dec 15, 2006
2,445
0
Montréal, Canada
Yeah, I just put an image instead. The image says "Stop Pirating this App" or something like that. You said dont use something like that, why not?

an image of text will be fine, except for localization purposes... but i mean, who is really going to localize this type of message?

i've been reading about several methods which allow people to crack iPhone apps. the most prominent is to scan for string objects to either remove or change them rendering the anti-piracy method ineffective. so it seems you are at a greater risk if you use unencrypted string objects as they can be easily located.
 

simplymuzik3

macrumors 6502a
Original poster
Jan 29, 2009
589
0
an image of text will be fine, except for localization purposes... but i mean, who is really going to localize this type of message?

i've been reading about several methods which allow people to crack iPhone apps. the most prominent is to scan for string objects to either remove or change them rendering the anti-piracy method ineffective. so it seems you are at a greater risk if you use unencrypted string objects as they can be easily located.

Oh, okay. Makes sense. Thanks for the info :D
 

peacetrain67

macrumors member
Dec 20, 2007
68
0
Oh, okay. Makes sense. Thanks for the info :D

ha, im subscribed to you on youtube and watched your tutorial about 20 minutes before seeing this thread, little did i know it was you again... haha. ps if you wanna make a tut on using the ipod functionality within the app (and itd be a welcome addition to your app, which i did pay for), im pretty sure youd be the first to make such a tut cuz i havent seen any and i sure have looked.
 

simplymuzik3

macrumors 6502a
Original poster
Jan 29, 2009
589
0
ha, im subscribed to you on youtube and watched your tutorial about 20 minutes before seeing this thread, little did i know it was you again... haha. ps if you wanna make a tut on using the ipod functionality within the app (and itd be a welcome addition to your app, which i did pay for), im pretty sure youd be the first to make such a tut cuz i havent seen any and i sure have looked.

haha, thanks for subscribing and purchasing my game :D For the tutorial, I'll try to make that, but right now Im already so backlogged with requests. I don't know how to even do it yet, so when I learn how to use the iPod stuff, I will make the tutorial! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.