1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Android Google Play Licensing extension requests read_phone_state, editing manifest doesn't fix

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Guest, Apr 29, 2019.

  1. Guest

    Guest Guest

    The official Google Play Licensing extension modifies your APK so that it requests read_phone_state. This permission does not appear checked in either Android Options or in the extension's list of permissions.

    This bug was originally reported in 2017, and it sits in Mantis as a "low" priority "suggestion." It's popped up on the forum once or twice but without a fix. I've looked at the Android manifest for both the runner and the extension, and neither requests this permission. I've tried adding/injecting a line to remove the permission, but when compiling I just get the message "this line of code is trying to remove something that wasn't asked for" (or, to be precise, "uses-permission#android.permission.READ_PHONE_STATE was tagged at AndroidManifest.xml:17 to remove other declarations but no other declaration present").

    That's my technical limit... according to the bug report, the extension might simply be doing something wrong: "I suspect that the extension uses the TelephonyManager in order to get access to unique identification id:s, which should be replaced by the modern way of doing it: ANDROID_ID."

    So, my options next are to (1) learn barely enough Java and Google API stuff to figure out what that comment meant, then go in and fix it; (2) beg our heroes @Mert or @Appsurd to fix it for YYG; or (3) just don't use Google Play Licensing.

    Or maybe I'm goofy and doing something wrong? I'd really like that to be the answer.

    Edit: Okay, the extension's own java code is only 158 lines, and it does appear to use android_id to get the device id, contrary to the bug report comment. Disclaimer, I don't know anything about this...

    Edit: This stackoverflow thread (which is about Play Services) suggests the issue may be in Google's SDK circa 2016 when YYG made their extension (and haven't since updated). I wonder how possible it would be to update the SDK within the extension. Probably more complicated than it sounds. ... Edit: I deleted the SDK in the extension, copied over the market licensing SDK library from android-sdk\extras, copied strings.xml from the original extension's sdk\allib\res\values folder to the new (because it needed it), and the thing actually compiled, but it still ultimately requests read_phone_state according to the Play Store console. I'm completely out of ideas.
     
    Last edited by a moderator: Apr 29, 2019
  2. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    238
    Unfortunately I have never used Play Licensing. There has been a request from a user to verify its implementation in GMS a while ago. We were planning to investigate the issue somewhere in the near future, but until now, we haven't been able to do so.

    Updating the SDK version is *a lot of* work. My knowledge is sufficient to edit YoYo's (sometimes crappy) extension, but updating an SDK version is something else..
    For now, I cannot help you out. Still busy with converting GMS1.4 projects to 2.2 so haven't got much time either :(

    PS: I would like to mention the hero @Kaguva as well, although he's a little expensive ;)
     
    Kaguva and Guest like this.
  3. rmanthorp

    rmanthorp YoYo Games Staff Admin YYG Staff

    Joined:
    Apr 15, 2016
    Posts:
    301
    Hey, looked into this and it seems the bug has been fixed for 2.2.3 https://bugs.yoyogames.com/view.php?id=30695 but it will require a runtime update and not simply an extension update. Sorry for the old report going untouched for so long, we had crossed wires with 2 matching reports.
     
    Guest likes this.
  4. Appsurd

    Appsurd Member

    Joined:
    Jun 20, 2016
    Posts:
    238
  5. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    410
    Hey :)
    As far as I know, the only permission we need here is com.android.vending.CHECK_LICENSE. Currently I'm working on the Firebase - Firestore extension which needs a bit focusing, so I'm unable to look into it for now.

    By the way, one of the community members posted a Google Play Billing extension which got me really excited to be honest. I posted a tutorial about it here. Try to ask the user, maybe he wishes to look into it.
     
    Guest likes this.
  6. Guest

    Guest Guest

    The tutorial is very timely, thank you! I was looking at his extension and documentation yesterday, it'll be very helpful to have your tutorial on how to use it as well.
     
    Mert likes this.
  7. Andrey

    Andrey Member

    Joined:
    Jun 21, 2016
    Posts:
    281
    Adding a string to the manifest:
    Code:
    <uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
    solve this problem.
     
  8. Guest

    Guest Guest

    I really appreciate the reply! Thank you. I did try that first thing. That does not work for me, however, it just gives me this message and the app still shows as requesting "phone" permissions:

    Code:
    :com.test.snake:processDebugManifest
    Q:\com.test.snake\src\main\AndroidManifest.xml:80:3-93 Warning:
        Element uses-permission#android.permission.READ_PHONE_STATE at AndroidManifest.xml:80:3-93 duplicated with element declared at AndroidManifest.xml:14:1-71
    Q:\com.test.snake\src\main\AndroidManifest.xml:29:3-79:17 Warning:
        application@android:label was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
    Q:\com.test.snake\src\main\AndroidManifest.xml:30:5-39:16 Warning:
        activity#com.test.snake.RunnerActivity@android:label was tagged at AndroidManifest.xml:30 to replace other declarations but no other declaration present
    Q:\com.test.snake\src\main\AndroidManifest.xml:80:3-93 Warning:
        uses-permission#android.permission.READ_PHONE_STATE was tagged at AndroidManifest.xml:80 to remove other declarations but no other declaration present
    Code:
    :com.test.snake:processReleaseManifest
    Q:\com.test.snake\src\main\AndroidManifest.xml:80:3-93 Warning:
        Element uses-permission#android.permission.READ_PHONE_STATE at AndroidManifest.xml:80:3-93 duplicated with element declared at AndroidManifest.xml:14:1-71
    Q:\com.test.snake\src\main\AndroidManifest.xml:29:3-79:17 Warning:
        application@android:label was tagged at AndroidManifest.xml:29 to replace other declarations but no other declaration present
    Q:\com.test.snake\src\main\AndroidManifest.xml:30:5-39:16 Warning:
        activity#com.test.snake.RunnerActivity@android:label was tagged at AndroidManifest.xml:30 to replace other declarations but no other declaration present
    Q:\com.test.snake\src\main\AndroidManifest.xml:80:3-93 Warning:
        uses-permission#android.permission.READ_PHONE_STATE was tagged at AndroidManifest.xml:80 to remove other declarations but no other declaration present
    To be clear, the app does not actually require or prompt the user for this permission. The problem is that if you view the permissions requested through the Play Store, it will show that it asks for those permissions. In my opinion, that makes the app look like a scam or trojan.
     
  9. Andrey

    Andrey Member

    Joined:
    Jun 21, 2016
    Posts:
    281
    In the store I see only:
    • view network connections
    • full network access
    • control vibration
    • Google Play license check
    anywhere read phone state, I do not find.
     
  10. Guest

    Guest Guest

    Thank you for that... that suggests maybe I'm doing something wrong on my side. I'll mess around more with the manifest in case I'm putting it in the wrong place or something.
     
  11. Andrey

    Andrey Member

    Joined:
    Jun 21, 2016
    Posts:
    281

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice