1. Download our Official Android App: Forums for Android!

Apps Protect My App From illegal share (make it can't be run if it's not installed from google play

Discussion in 'Android Development' started by Hyder61112, Aug 5, 2016.

  1. Hyder61112

    Hyder61112 Lurker
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    2
    Joined:
    Aug 5, 2016

    Aug 5, 2016
    2
    3
    16
    Male
    Good evening everyone.
    I've made a game called "LAUC" For Android.

    How do I make the game can't be run if it's installed from out of google play ?.
    Just like spiderman 2 "the app is not installed from google play. Please reinstall it"

    I want to sell my game for 3.9$
    But I don't want it to be shared for free.

    Because That's not fair.

     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,846
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,846
    11,450
    1,988
    Male
    Software developer
    South West of England
  3. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,297
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,297
    23,692
    2,138
    Male
    space alien ;)
    Indy
    Hey @Hyder61112, welcome to AF :).

    I'm not sure you can make the app protect itself since there's (currently) no way that I know of that an app can tell how it was installed.

    I.e., I don't know how the Spiderman app does this--would be curious to know, though...

    I believe that Android Nougat is going to tell you how an app was installed, but I'm not sure if there's an API for you to call to check that inside your app (you would think there would be (or already is/might be...)).

    Perhaps @LV426 has a better insight on protecting yourself...

    Cheers!
     
    Hyder61112 and Android__X like this.
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,846
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,846
    11,450
    1,988
    Male
    Software developer
    South West of England
    I slightly misread the question. OP wants protection from copying and/or reverse engineering.
    The sad fact is that it's virtually impossible to prevent someone from hacking your APK. You can use code obfuscation tools to make life more difficult for hackers. But it's still possible to reverse engineer the code, and there are some clever people out there.
    This answer explains things well -

    http://stackoverflow.com/questions/9865162/how-to-secure-my-app-against-piracy
     
  5. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,297
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,297
    23,692
    2,138
    Male
    space alien ;)
    Indy
    #5 scary alien, Aug 5, 2016
    Last edited: Aug 5, 2016
    Hyder61112 likes this.
  6. eshieldsvx4

    eshieldsvx4 Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    99
    Joined:
    Feb 16, 2014

    Feb 16, 2014
    99
    41
    53
    Male
    There's a better way. Add a line in the manifest.xml that includes a prerequisite that only Google Play can allow.

    Or, allow the game to be downloaded, but insert the IAP in the app itself so that even if it's sideloaded, you'll need to pay for it anyway.
     
    Hyder61112 and Android__X like this.
  7. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,297
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,297
    23,692
    2,138
    Male
    space alien ;)
    Indy
    What line would that be?

    I'd be very interested to know that, thanks! :)
     
    Hyder61112 and Android__X like this.
  8. mikedt

    mikedt 你好
    Rank:
     #4
    Points:
    3,238
    Posts:
    25,094
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    25,094
    14,054
    3,238
    Teachaaa
    Jinan, China
    Yes Spider-Man 2, that's not installed from Google Play.
    [​IMG]

    There's some clever people in China. :thumbsupdroid: Basically it's pretty much impossible to protect your app from piracy, and unauthorized distribution.
     
    Hyder61112 and Android__X like this.
  9. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,846
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,846
    11,450
    1,988
    Male
    Software developer
    South West of England
    If there is such a line in the manifest, I would expect the hacker could remove it and reconstruct the APK.
     
    Hyder61112 and scary alien like this.
  10. mikedt

    mikedt 你好
    Rank:
     #4
    Points:
    3,238
    Posts:
    25,094
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    25,094
    14,054
    3,238
    Teachaaa
    Jinan, China
    You can protect your app or game if it uses an online server component, e.g. try playing Pokémon Go in China, you can, but it requires quite a lot of hackery on the user's part and a rooted phone.
     
    #10 mikedt, Aug 6, 2016
    Last edited: Aug 6, 2016
    Hyder61112 likes this.
  11. Jhayzone

    Jhayzone Android Enthusiast
    Rank:
    None
    Points:
    118
    Posts:
    385
    Joined:
    Oct 21, 2015

    Oct 21, 2015
    385
    223
    118
    If that is possible wouldn't you expect popular companies that releases paid games like kemco and square enix to have done this already? Its sad since company like Kemco regularly releases quality RPGs but the sideloading became so bad that they were forced to release their newer games fully free, FULLY FREE! with the option to pay for a "premium" version if you appreciates their work. I just bought again a game from them ealier because they are really that good.
     
    Hyder61112 and scary alien like this.
  12. eshieldsvx4

    eshieldsvx4 Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    99
    Joined:
    Feb 16, 2014

    Feb 16, 2014
    99
    41
    53
    Male
    I only dabble with my SDK so I can't tell you exactly. I know of it because some apps I install from 3rd party stores don't work because of it.

    It's associated with the permission "Google Play License Check".
     
    Hyder61112 likes this.
  13. scary alien

    scary alien not really so scary
    Moderator
    Rank:
     #8
    Points:
    2,138
    Posts:
    22,297
    Joined:
    Mar 5, 2010

    Mar 5, 2010
    22,297
    23,692
    2,138
    Male
    space alien ;)
    Indy
    Sounds like you are speaking about this https://developer.android.com/google/play/licensing/adding-licensing.html:

    Adding the Licensing Permission

    To use the Google Play application for sending a license check to the server, your application must request the proper permission, com.android.vending.CHECK_LICENSE.
    If your application does not declare the licensing permission but attempts to initiate a license check, the LVL throws a security exception.

    To request the licensing permission in your application, declare a <uses-permission> element as a child of<manifest>, as follows:

    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
    For example, here's how the LVL sample application declares the permission:

    Note: Currently, you cannot declare the CHECK_LICENSE permission in the LVL library project's manifest, because the SDK Tools will not merge it into the manifests of dependent applications. Instead, you must declare the permission in each dependent application's manifest.
    Then there is further information later on in that page for Checking the License from an Activity and Overview of license check and response.

    Adding the policy and license checks would indeed seem that it might help protect an app as it would make it much more difficult for those that would decompile and hack/tweak the .apk, especially if obfuscation code were added--difficult, but not impossible.

    Also, see this overview page:

    which points-out:

    Requirements and Limitations

    Google Play Licensing is designed to let you apply license controls to applications that you publish through Google Play. The service is not designed to let you control access to applications that are not published through Google Play or that are run on devices that do not offer the Google Play client.
     
    #13 scary alien, Aug 6, 2016
    Last edited: Aug 6, 2016
  14. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,846
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,846
    11,450
    1,988
    Male
    Software developer
    South West of England
    I'm actually surprised that Google haven't put robust measures in place to stop app piracy. But then, reverse engineering has always been an inherent weakness in Java, as the bytecode can easily be decompiled.
    However Google have some very clever people working for them, so I would have expected a bit more support for anti-piracy measures, or at least some anticipation that such problems would occur.
     
  15. mikedt

    mikedt 你好
    Rank:
     #4
    Points:
    3,238
    Posts:
    25,094
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    25,094
    14,054
    3,238
    Teachaaa
    Jinan, China
    Apple thought they did, and iOS app piracy still happens.

    And as for Windows Phone app piracy...why bother? :D
     
    Hyder61112 and LV426 like this.
  16. eshieldsvx4

    eshieldsvx4 Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    99
    Joined:
    Feb 16, 2014

    Feb 16, 2014
    99
    41
    53
    Male
    You pulled up the whole schpiel. Thanks that just about sums up my intent
     
    Hyder61112 likes this.
  17. eshieldsvx4

    eshieldsvx4 Well-Known Member
    Rank:
    None
    Points:
    53
    Posts:
    99
    Joined:
    Feb 16, 2014

    Feb 16, 2014
    99
    41
    53
    Male
    Developers for Android have more room to be creative than iOS.

    I enjoy and benefit from root access, but prop normalizers are dangerous. And I think they should be used only for debugging purposes, not to get around limitations.
     
    Hyder61112 and mikedt like this.
  18. Hyder61112

    Hyder61112 Lurker
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    2
    Joined:
    Aug 5, 2016

    Aug 5, 2016
    2
    3
    16
    Male
    Thanks for all who suggested me to do something.
    I'll try the IN-GAME Purchase system.
    It's the best.

    Thanks for all.
     
    eshieldsvx4, mikedt and scary alien like this.

Share This Page

Loading...