objective-c scrambler

Discussion in 'iOS Programming' started by yaniv92648, Apr 25, 2010.

  1. yaniv92648 macrumors member

    Joined:
    Oct 26, 2009
    #1
    Hi,
    i searched the web but didn't find it. it's simply a tool for scrambling/encrypting the code so that it is compilable but not readable/understandable (classes, methods, etc.. cannot be copied to other uses).
    Thanks!
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  3. yaniv92648 thread starter macrumors member

    Joined:
    Oct 26, 2009
    #3
    because..

    i'm selling my app to someone and i don't want him to use my code for other purposes.
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    If you are selling the source code then I would expect that he has the rights to do whatever he wants with it. I would expect to pay significantly less (well under 50%) for scrambled source. What if there is a bug in the code, or the code needs to be updated for a new Apple API and it's scrambled. That's a whole lot more work.

    Have you agreed with the buyer that the code will be scrambled so almost unmaintainable?
     
  5. yaniv92648 thread starter macrumors member

    Joined:
    Oct 26, 2009
    #5
    the agreement

    The agreement we had is on that i sell my app to him and he uploads it to the appstore. the agreement didn't include that he can use the code for other purposes, only for the purpose of uploading the app to the appstore.
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Well then why don't you send him a compiled but unsigned binary. He should then be able to sign the binary for upload (I think, I've never had to do this).

    The issue I see with scrambling the code is that you can only scramble your own method names: you cannot scramble any delegate method names as the name is actually used at runtime. The same applies to the names of table datasources.

    Even with scrambled method names it would not be all that tricky to use the debugger to find out what each method does.

    So, basically, there is a limited amount you can gain from scrambling anyway...
     
  7. yaniv92648 thread starter macrumors member

    Joined:
    Oct 26, 2009
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    Yes, but it must be unsigned. The will then sign with their distribution key. Of course if they just gave you the key you could sign it yourself and send them the signed binary.
     
  9. skunkworker macrumors regular

    Joined:
    Sep 9, 2007
    #9
    Why don't you just get him to sign a legal document saying that he won't use the source code for any other purposes and if he does legally sue him for it?
     
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    I was hoping he already had a legally binding contract covering the sale and this was just added protection...
     
  11. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #11
    To scramble your C code, just compile it, with optimization turned on and debug symbol generation turned off, into a static library.

    Then send the static library to your customer with instruction on how to compile the library code into an app.

    To scramble your Objective C code, you might need a script that will go into the source code and replace all the object and method names, as these appear in plain text in your app bundle. (e.g. you probably want to change "[registrationCheckObject isRegistered] == YES" into "[x328974274 y934204] == 2938.7434985", etc.)
     

Share This Page