Disable runtime permissions check for Android M root - android

Is there anyone who know how to disable danger permissions check for rooted android 6 or grant all of them automatically for my app?
I have rooted tablet Samsung sm-819 with android 6 and an application which used one set of permissions but now I must extend functionality of the application therefore app needs more permission.
The problem is that the app stuck to the screen and only shows ads in taxi cab. It's never interact with user and new permissions can't be granted...
Please help me to find any information about it. I know that it's possibly because different devices don't have the same set of dangerous permission.

You can achieve this by setting targetSdk below 23.
If you are using targetSdk 23 or above, then you need to implement the runtime permission.

Related

How do I request android runtime permissions the way like in image below?

I found an .apk file and laucnhed on emulator. On start it requests permissions via dialog I have never seen before. I want to create same dialog in my app but I can't find the way dialog below is implemented. I have read many questions on SO and explored some docs but that wasn't I'm looking for. Could you help me to implement request permissions dialog like on the picture?
What you're seeing is permission screen for legacy apps that was added in android 10:
If your app targets Android 5.1 (API level 22) or lower, users see a
permissions screen when using your app on a device that runs Android
10 or higher for the first time, as shown in Figure 1. This screen
gives users the opportunity to revoke access to permissions that the
system previously granted to your app at install time.

Strange behaviour in Android M Permissions

So I have this app that I made before the Android M came out, the app has permissions such as Camera(using custom camera within the app) Write & Read from external storage and System Alert permission I installed the app to my phone which has android 6.0 and the app was able to run normally and without any restrictions. I was able to use the camera, save files into sdcard & show a custom view using the WindowManager API.
please take a note that the target SDK for the app is android lollipop.
my question: is this even possible? the OS let apps that has target SDK smaller than M to run perfectly without asking for permissions? and if this is actually the default behaviour that android developers implement?
P.S: the identified question is not really applicable for my question. and i don't see any similarity between them at all.
Yes, it is possible. But that can give you a big problem. If the user deactivates some permission your app simple crushes because the permission is no longer available. The OS ask the user "This app was developed for a previous android version. disabling this permission can cause unexpected closing of the app" (ore some thing similar). In conclusion this is the normal behaviour because the android version that you are using to compile your app is before permissions needed to be confirmed by the user.
https://inthecheesefactory.com/blog/things-you-need-to-know-about-android-m-permission-developer-edition/en
this link explains all you need to now about your question .
Yes, if your app has targetSdkVersion below 23, it will work on M and above without asking any permissions (they will be asked during installation).
But if user will revoke any permission himself, app will crash. It was made by Google to get backwards compatibility with old applications that does not support new Permissions API.
You can read more about it here.
Here is quote from that page:
If the device is running Android 5.1 or lower, or your app's target
SDK is 22 or lower: If you list a dangerous permission in your
manifest, the user has to grant the permission when they install the
app; if they do not grant the permission, the system does not install
the app at all.

Android 6 target sdk=23 permissions on install

I know that if you set target sdk to 23 you now need to ask the users for "dangerous" permissions at runtime like was responded here:
Android 6.0 Permission Error
But some permissions are listed as "normal" and they are required when the app is installed. Is it possible to somehow mark some of the "dangerous" requirements that we have in our manifest to act as "normal" (to require them on install and not at runtime) because without some of them the app cannot actually function properly. Just rewriting everything to ask permissions at runtime is not really an option at the moment, but we will probably do that in the future.
No. There is no way to do what u want.
If you don't have the time to develop it now, you should target SDK 19 (permissions were introduced on Lollipop 21)
edit:
my bad, you should target API 22, as permissions were introduced on API 23. But still, target a lower API is the best option until you have time to properly develop the permission model.
Is it possible to somehow mark some of the "dangerous" requirements that we have in our manifest to act as "normal" ?
No it is not possibile.
The only way to avoid managing the runtime permissions is to use target 22.
But pay attention.
The users can revoke permissions from any app at any time, even if the app targets a lower API level

Clarity on the key changes of marsh mallow 6.0

I'm wanting to clarify on the key changes of marsh mallow 6.0.
Are there any changes that we need to be aware of as developers, as opposed to user only or OS features that do not affect development.
If so how do we manage these changes? example do we need to disable a feature, will it cause application crashes or it will open the setting page and asking for enabling the feature for that application.
I was so confused about how the recent changes affect developers, I was looking for some clarity.
As far as I can see there's no need to enable or disable features, the developer needs to be mindful of what target sdk they are developing in when creating or updating apps.
The biggest change to developers in the latest upgrade is Runtime Permissions.
Taken from:
Everything every Android Developer must know about new Android's Runtime Permission
Although Android is being keep developed but the latest update to Android M is totally different since there is some major change that would change everything like new Runtime Permission. Surprisingly it is not much talked about in Android Developer community even though it is extremely important and may cause some big trouble in the near future.
.../...
You might already feel like there is some cold wind blowing through your arms ... If you are an Android Developer, you will suddenly know that programming logic is totally changed. You cannot just call a function to do the job like previous but you have to check for the permission for every single feature or your application will just simply crash !
Correct. I would not spoil you that it is easy. Although it is a great thing for user but it is truly nightmare for us developer. We have to take coding to the next level or it will surely have a problem in both short-term and long-term.
Anyway this new Runtime Permission will work like described only when we set the application's targetSdkVersion to 23 which mean it is declared that application has already been tested on API Level 23. And this feature will work only on Android 6.0 Marshmallow. The same app will run with same old behavior on pre-Marshmallow device.
This means user permissions are not being requested at install time, but at runtime. This is done using a permission request, and can be saved by the user for one run of the app, or as a default 'always'. This permission can always be revoked in the device settings.
As the api is backward compatible, any devices running with apps of targer sdk < 23 will still be ok.
However these same apps will not run on android devices >= 6.0 with a target sdk of 23 if the runtime permissions are not implemented and the user failing to give permission needs to be managed to stop apps from crashing.
The only manisfest permissions that will require runtime permission requests are those that are deemed as a dangerous permission level, so accessing personal information, camera, etc.
Permissions are grouped and once a permission is given for one item of a group, permission is then granted for the remaining permissions of the group.
For more detail Sytem - Permissions.

Will my old app works normally on Marshmallow?

I have an old app which I have to make small changes to, create a new version and update it to Google Play. Do I need to implement the new asking permissions on runtime type? Or can I just update the new version and it will work fine on Marshmallow?
The new Runtime Permission will work only when we set the application's targetSdkVersion to 23. And this feature will work only on Android 6.0 Marshmallow and above. The same app will run with same old behavior on pre-Marshmallow device.
If the device have Marshmallow or above, but your app's TargetSdkVersion < 23, Your app will continue to use the old permissions model, but the user can revoke permissions any time.
Any way if your app declares in its manifest that it needs a normal permission, the system automatically grants the app that permission at install time.
It should still work fine if you use targetSdkVersion 22 or less. If you set targetSdkVersion 23, then your app will crash if you attempt to use a "Dangerous permission" that you did not ask the user for at runtime. Take a look at this page:
https://developer.android.com/training/permissions/requesting.html
yes, it will work on marshmallow.
just include the "target api" to '23' in your manifest file.

Categories

Resources