Why is my app requesting permissions I didn't ask for? - android

my APK is requesting these permissions:
android.permission.ACCESS_NETWORK_STATE
android.permission.BIND_NOTIFICATION_LISTENER_SERVICE
android.permission.INTERNET
android.permission.READ_EXTERNAL_STORAGE
android.permission.READ_LOGS
android.permission.WRITE_EXTERNAL_STORAGE
I can see that when I try to publish the APK on the play store or when I try to install the APK on my physical device.
However, my app manifest only has:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />
Why would my app request the other permissions?
My solution has a Xamarin.Forms PCL project, a shared PCL utilities project and the native Android project.
I'm using SQLite.NET (it doesn't require these permissions) could it be related?
Any ideas?
EDIT: Here is the entire manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.SpaceMonkey.Boats">
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="21" />
<application android:label="Boats" android:icon="#drawable/anchor" android:theme="#android:style/Theme.Material"></application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" />
</manifest>

Acording to this article Xamarin.Insights.dll manifest have this:
[assembly: UsesPermission("android.permission.WRITE_EXTERNAL_STORAGE")]
[assembly: UsesPermission("android.permission.INTERNET")]
Could be this your case?

Related

Android React Native App asking for permissions that are not defined within android/app/src/main/AndroidManifest.xml

I have a Android build of a react native app that I have uploaded to the Google Play console.
I am having issues with the build of the app requesting more permissions than I have defined inside my apps android/app/src/main/AndroidManifest.xml
I am having troubles with the QUERY_ALL_PACKAGES permission in particular which Google says my app is not compliant with.
The permissions defined inside my app android/app/src/main/AndroidManifest.xml are the below:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING"/>
I then did a global search for QUERY_ALL_PACKAGES in my project and found it was defined in several places like:
android/app/build/intermediates/merged_manifests/release/AndroidManifest.xml
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- Required to access Google Play Licensing -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" /> <!-- Required by older versions of Google Play services to create IID tokens -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
and the android/app/build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!--
Required to access Google Play Licensing -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" /> <!-- Required by
older versions of Google Play services to create IID tokens -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission
android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"
/>
What are these files and why are they requiring permissions I have not set inside my android/app/src/main/AndroidManifest.xml
How would I go about removing a permission requested by these files like the android.permission.QUERY_ALL_PACKAGES
Any help or guidance would be greatly appreciated.
Best,
Matt
By default, some permissions are added to your Android APK. To remove them, just add few lines in android/app/src/main/AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myappid"
+ xmlns:tools="http://schemas.android.com/tools"
>
+ <uses-permission tools:node="remove" android:name="android.permission.QUERY_ALL_PACKAGES" />
.....
</manifest>
Also you can find the reference here in the official documentation : https://reactnative.dev/docs/0.62/removing-default-permissions
I would recommend in addition to the other answer provided find out which library in your project is trying to add that permission and remove it. That permissions should be rarely used as it's able to grab the package names of every app the user has installed. It's not a recommended practise.

Android Studio: "run at startup" missing permission

I just published my app in the Google Playstore and it has "run at startup" feature turned on, but I don't have any permission for it in my AndroidManifest. Why is this happening? How could I remove it?
My AndroidManifest permissions:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="com.android.vending.BILLING"/>
It's because of the move from com.google.android.gms:play-services-ads:19.4.0 to com.google.android.gms:play-services-ads:19.5.0

How to filter the supporting android device at the time of publishing the android app?

I had finished my android app. App build version is 4.1.2. Now, i uploaded my apk into google console, it displays more that 4000 supporting devices. I am not sure my app will work on all the 4000 devices or not. My app is developed only for mobile.Can any one guide me how to filter the supporting devices ? Do i need any configuration in manifest file ?
please, look at my manifest file:-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demo"
android:versionCode="1"
android:versionName="1.0.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="20" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application>
......
....
<activity
.....
...../>
<application/>
*No need of any changes,the permission which you have given in manifest on that it will calculate the supporting device so better you remove the permissions which are not required and recheck ....it may show the less...
NOTE :Example permissions like:Remove which are not required....
While publishing the apk there is an option for you to see in apk section the list of devices to be supported. You can view the devices supported and exclude them from the list. Pl. refer to the below stack overflow link it provides you all the option
How to restrict android app to specific device make?

App compatibility with Android devices

There is an application which can not be runed on particular devices. I have this in Manifest.xml:
<uses-sdk android:minSdkVersion="8" />
And it works on HTC sensation with Android 4.0, but for some reason it is not compatible with Samsung Galaxy Tablet 2 7.0. (Android 4)
When I upload it in Android market, also I can see that the Tablet is not supported.
I can not understand the reason, can you please let me know why?
Manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
package="test.newversion"
android:versionCode="1"
android:versionName="2.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/app_logo"
android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps" />
</application>
</manifest>
Some permissions implicitly add requirements on the hardware. For example the docu for CAMERA says:
This will automatically enforce the manifest element for all camera features. If you do not require all camera features or can properly operate if a camera is not available, then you must modify your manifest as appropriate in order to install on devices that don't support all camera features.
If you don't need all, add explicit uses-feature elements with android:required="false"
try to give a luck to the following in manifest if not yet added
<supports-screens android:smallScreens="false"
android:normalScreens="true" android:largeScreens="true"
/>
change it according to your criteria
Most likely it is the permissions that are creating a filter which makes the marketplace removes some Tablets.
For e.g. you have the PHONE permissions in your manifest and if the Tablets do not have a phone capability, then they will not be compatible. As Henry suggested, you might look at the uses-feature with the android:required="false".
I suggest you review the AndroidManifest.xml carefully and proceed from there.

Motorola Xoom XML Manifest

Is there anywhere that I can find a list of the Features that the Xoom has, so that I can update my manifest file accordingly.
Currently the application is not in the Market, and Im not sure what is hindering it.
These are the current Permissions :
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Thanks
If you are planning to run your application on Android 3.1 then you should set the targetSdkVersion to 12. This may be what's preventing it from showing up in the market. The documentation on targetSdkVersion is not very clear on this, but it's worth a try I suppose. http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Categories

Resources