Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Protecting source code.

Discussion in 'General Discussion' started by MD_Reptile, Jan 23, 2015.

  1. frankprogrammer

    frankprogrammer

    Joined:
    Apr 27, 2009
    Posts:
    17
    If you are using the Mono scripting backend on Android, then you are shipping your game with plain english C# files. It takes about two minutes to go from downloading the apk off a site or copying it off a phone to having a full .sln of your game. All that is missing is the preprocessed stuff like comments and #if UNITY_IPHONE. Almost EVERY Unity game on Android ships like this. The only real solution is to use IL2CPP. It is still marked as experimental, but I hear it is almost 100%. The last I heard, they expected it to be 100% in Unity 5.4.

    If you are making a multiplayer Unity game and shipping with Mono, you are asking for problems.
     
    Meltdown and kaiyum like this.
  2. BasHeemskerk

    BasHeemskerk

    Joined:
    Aug 24, 2019
    Posts:
    1
    idk if this is still relevant lol, but you can better try adding in some protection, like a script that for example (like the GB (GameBoy), checks if the letters or menu is still the same at startup. on the GB when the GB logo said something else then: Gameboy, the game wouldnt start. thats maybe a way you can use. and also if you do that make sure ALL scripts rely on that code. that makes it WAY harder to crack.
     
  3. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,822
    This thread is from four years ago and this isn't even good advice because
    1. you can literally emulate every game boy game
    2. you've been able to do this since the 90s
    3. this isn't source code protection at all
    4. once the user has access to the game on their own computer, all bets are off
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,204
    No. Any technique that is included in the source code of the game isn't even remotely close to being secure. Worse yet a technique like you describe is old school and very easily broken. It's right up there with having the app check for a fake defect in the disk it ships with, having it verify a registration number, or using a wheel to select a symbol or color.

    If multi-billion dollar studios can't solve this problem there is absolutely no way an amateurish trick will be the solution.
     
    Last edited: May 20, 2020
    Joe-Censored and MD_Reptile like this.
  5. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Your advice is even more obsolete than this thread.

    Nowadays you can use IL2CPP for Android builds, so outright source code theft is no longer a thing unless you mistakenly submit builds using Mono. Decompiling C++ binaries into usable source is far from practical and the few tools that can do that are obscenely expensive, and even then the results aren't ready to use at all.
     
  6. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,024
    https://github.com/avast/retdec

    And I'm not saying it is easy or you should fear it, just that it is open source and free and practical.

    ----

    Do not concentrate on protection of you source code, concentrate on making great games instead.
     
    Ryiah likes this.
  7. ChazBass

    ChazBass

    Joined:
    Jul 14, 2013
    Posts:
    153
    If you go back and read all of those posts on this topic and related topics, you'll see that the consensus is that there are two possibilities:

    1) Your game will attract no interest and no one will be interested in trying to de-compile it, pirate it, etc.

    2) Your game is successful, and while there might be folks out there who want to try to steal it, all the other untold thousands will be happy to just buy it from you. You'll be making a lot of money and won't care.

    Yes, there are cases where games have been stolen in some fashion and ended up on whatever Pirate Bay du jour site happens to be popular at the time, or circulating in markets such as China. But even in those cases, the consensus is that none of the folks sourcing it are really potential customers anyway. In short, a high class problem.
     
    Ryiah likes this.
  8. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    I'm still a bit proud our game got cracked by Skidrow. I would have been even happier if it was Razor 1911 though :D
     
    Lurking-Ninja and MD_Reptile like this.
  9. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    All these years later and my current thinking is that A) I'd be like the above poster, and proud as S*** if something I made got popular enough to be pirated and B) any effort spent trying to "hide" pretty regular everyday code is a waste compared to spending the same effort making a better end product to begin with and C) if somebody in some obscure scenario does in fact directly copy code somehow from your project if you have some kind of wicked awesome and unique example of something that has never been done (obviously extremely rare) they probably are not going to be directly stealing your traffic of paying customers or disrupting it anyway, and if you made something that special, you likely have plenty of money due to its success to go ahead and defend it in legal battles...

    So yeah... I flip the magic switch that spits out IL2CPP code and forget about it these days :D
     
  10. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Its pretty cool how we already can emulate Switch games like Mario odyssey, it took many more years until we could emulate Wii for example. Give it another year and it will just not run smoother but look better than the actual console :)