How to "Force Close" and Application?

Discussion in 'iOS Programming' started by simplymuzik3, Aug 25, 2009.

  1. simplymuzik3 macrumors 6502a

    Joined:
    Jan 29, 2009
    #1
    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!
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    i'm curious how you are implementing anti-piracy security into your app. please give details.
     
  4. simplymuzik3 thread starter macrumors 6502a

    Joined:
    Jan 29, 2009
    #4
    Here's the tutorial I made for anti-piracy: http://www.youtube.com/watch?v=Cy4hCuadRuA

    Hope that's what you were looking for! Let me know if you need more info!
     
  5. Troglodyte macrumors member

    Joined:
    Jul 2, 2009
    #5
    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.
     
  6. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #6
    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
     

    Attached Files:

  7. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #7
    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.
     
  8. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #8
    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
     
  9. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #9
    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?
     
  10. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #10
    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
     
  11. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #11
    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.
     

    Attached Files:

  12. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #12
    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.
     
  13. Howardchief macrumors regular

    Joined:
    Jun 9, 2008
    #13
    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.
     
  14. sammich macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #14
    Yeah, but if you put aggressive language or profanity in then you'd have to publish your app under a higher age limit:p
     
  15. simplymuzik3 thread starter macrumors 6502a

    Joined:
    Jan 29, 2009
    #15
    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?
     
  16. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #16
    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.
     
  17. simplymuzik3 thread starter macrumors 6502a

    Joined:
    Jan 29, 2009
    #17
    Oh, okay. Makes sense. Thanks for the info :D
     
  18. peacetrain67 macrumors member

    Joined:
    Dec 20, 2007
    #18
    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.
     
  19. simplymuzik3 thread starter macrumors 6502a

    Joined:
    Jan 29, 2009
    #19
    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
     
  20. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #20
    I am so glad that everyone is ignoring this "solution". Good job, people!
     
  21. simplymuzik3 thread starter macrumors 6502a

    Joined:
    Jan 29, 2009
    #21
    haha, it's okay. Some people already posted the solution above :D
     

Share This Page