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. Dismiss Notice

Meaning of Application.sandboxType (can it detect rooted devices)

Discussion in 'Scripting' started by FlashMuller, Sep 23, 2020.

  1. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    449
    Hey everybody,
    so I was checking options on how to avoid rooted devices joining my online mode and while researching a lot of complex solutions someone stated that you could simply use Application.sandboxType, specifically SandboxBroken. The documentation is a little thin on that topic, basically stating that this will return the Sandbox Type - yay. Generally this feature doesn't seem to be used too much - Google finds basically nothing about it.
    Long story short: What exactly do the return values of sandboxType mean and is it a (sufficient) approach to detecting rooted devices.
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,589
    If it doesnt have to be in code, google added the device catalogue option to its release management a couple years ago, which, if i remember correctly, can be used to exclude rooted devices from even downloading the app.

    This goes slightly off topic, but i'm curious as to why you want to exclude rooted devices from your online mode. Most people who root their phones do so to get rid of some forced installations, or to get access to the file system - or just generally to have more control. All of which should be part of default android imho.
     
  3. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    449
    Thanks for the reply, that would be a valid option.

    The thing with my online mode is that it creates costs on my side and i would like to avoid rooted devices skipping my financing mechanisms - which I read might well be possible. I am not settled on which way to go yet as I don't want to ban valid customers but also don't want potentially rising costs without any income. A tricky decision as there is barely any reliable data on rooted device count and abusive use.
     
  4. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,589
    I would start with figuring out how many percent of users you need to watch ads (or whatever you use for financing) to break even with your costs. Then make an educated guess (there may be statistics on that as well) for how many people with rooted phones use that to make ads disappear (assuming that's possible, i never rooted my phone).
    Then decide based on that whether you should stop people with rooted phones from accessing your online service. My guess would be that even if a fraction of them does not get rid of ads, you'd still make a profit. Also, more people using the service, the more free advertisement you get. Not to mention that blocking people out of your online service would make them leave bad reviews, which in turn makes paying customers download the app less likely. So all in all i personally dont think it is worth doing, but then again i recommend doing a bit more research and making an educated decision based on that.
     
  5. nareshbishtasus

    nareshbishtasus

    Joined:
    Jun 11, 2018
    Posts:
    35
    Most probably sandbox, in this case, refer to wether the app is published or in testing. For example when you release the app on play console under testing or in case of apple in testflight.