• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

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

G

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:

Appsurd

Member
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 ;)
 

Mert

Member
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.
 
G

Guest

Guest
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.
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.
 

Andrey

Member
Adding a string to the manifest:
Code:
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
solve this problem.
 
G

Guest

Guest
Adding a string to the manifest:
Code:
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
solve this problem.
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.
 

Andrey

Member
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.
 
G

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.
 
Top