Permission Nanny is an application that can access resources which are protected by permissions on your behalf

Related tags

App Permission-Nanny
Overview

Permission Nanny

Download Build Status Coverage Status Gitter

Permission Nanny is an application that can access resources which are protected by permissions on your behalf, so that your application does not need to declare permission usage in your AndroidManifest.xml. With Permission Nanny, it is possible for your application to not require any permissions at all, yet still be able to access permission-protected resources.

Why?

Android M introduces a new permission model - Runtime Permissions - where 3rd party applications are no longer granted permissions at install time. Instead, a dialog is displayed to the user, requesting authorization to access permission-protected resources when 3rd party applications would like to use them during runtime. However, the new Runtime Permissions model is built into the operating system and is only available in Android M and onwards. Pre-M users will have to wait for system updates, which unfortunately could take quite a while.

Permission Nanny is an attempt to backport Runtime Permissions to pre-M devices, all the way to Gingerbread 2.3

How does it work?

From a high-level perspective, Permission Nanny acts as a proxy server between client applications and the Android operating system. When a client needs to access a resource that is protected by Android permissions, the client will send a request to Permission Nanny. Permission Nanny will then show a dialog to the user, asking the user for authorization to grant the client access to the resource. If the user allows the request, Permission Nanny will access the resource and return results to the client; if the user denies the request, Permission Nanny will simply return an error response.

Will my existing code work with Permission Nanny?

Unfortunately, code changes are required to integrate your app with Permission Nanny. Fortunately, the Permission Nanny SDK is designed to mimic the Android SDK, hence the amount of work required should be minimal. Since you are going to make code changes to make your app work with M's Runtime Permissions anyways; why not try something that is supported all the way back to Gingerbread 2.3?

How do 3rd party apps communicate with Permission Nanny?

Clients communicate with Permission Nanny using broadcast Intents following the Permission Police Protocol (PPP). PPP is heavily inspired by HTTP with a few minor tweaks, borrowing attributes such as status codes, headers and entity. See Nanny.java for the full PPP specification.

How do I integrate my apps with Permission Nanny?

A Permission Nanny SDK is provided to facilitate issuing requests to and handling responses from Permission Nanny.

dependencies {
    compile 'com.permission-nanny:permission-nanny-sdk:a.b.c'
}

How do I make a request?

Use one of the static factory methods to create a request; attach a listener to receive results; finally send the request to Permission Nanny with .startRequest(). See PermissionRequest.java for more documentation. For example, to issue a WifiManager.getConnectionInfo() request:

WifiRequest request = WifiRequest.getConnectionInfo().listener(new SimpleListener() {
    public void onResponse(Bundle response) {
        Bundle entity = response.getBundle(Nanny.ENTITY_BODY);
        if (Nanny.SC_OK != response.getInt(Nanny.STATUS_CODE)) {
            NannyException error = (NannyException) entity.getSerializable(Nanny.ENTITY_ERROR);
            return;
        }
        WifiInfo info = entity.getParcelable(WifiRequest.GET_CONNECTION_INFO);
    }
}).startRequest(context, "Trust me");

How do I know if the user grants or denies my request for resources?

Permission Nanny will return a response in the form of a Bundle. The response will contain a status code which will tell you the user's decision. If the user authorizes the request, the response will contain the requested resources; otherwise, it will contain an error message.

What resources are supported?

Currently, AccountManager, LocationManager, SmsManager, TelephonyManager, WifiManager and all Content Providers are supported. See request factories for a detailed list of all available requests.

Are there any examples?

Check out the /appDemo directory or the demo app Permission Nanny Demo on Google Play.

Where can I find complete documentation?

Documentation is available but still a work-in-progress. Nanny.java & [PermissionRequest.java] permission-request-java are the most extensive documentation and should cover most areas of Permission Nanny.

Where can I ask questions?

Please direct your questions to the Permission Nanny mailing list; I will try my best to answer them.

License

See LICENSE for details.

You might also like...
Haven is an app to help people in need find resources.

Haven Haven is an app to help people in need find resources. Haven connects people to resources such as food pantries, homeless shelters, healthcare,

Brazilian Holidays: a Kotlin/Java library that provides resources to consult Brazilian holidays and business days

Leia esta documentação em Português. Brazilian Holidays Brazilian Holidays is a

Loco-strings-sync - A custom Gradle Plugin useful to sync loco string resources to local projects

loco-strings-sync A custom Gradle Plugin useful to sync loco string resources to

A curated list of great Android lint custom rules and resources

Awesome Android Lint A curated list of great Android lint custom rules and resources Contents Rules Articles Other Contribute Rules Google Sample Cust

AppUI Sample Application - display how you can create your own custom AppUI application within a few minutes
AppUI Sample Application - display how you can create your own custom AppUI application within a few minutes

AppUI Sample Application This is an open-source project to display how you can create your own custom AppUI application within a few minutes. I have a

Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:

Villains & Heroes Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information

NativeScript empowers you to access native platform APIs from JavaScript directly. Angular, Capacitor, Ionic, React, Svelte, Vue and you name it compatible.
NativeScript empowers you to access native platform APIs from JavaScript directly. Angular, Capacitor, Ionic, React, Svelte, Vue and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

Simple access to Firebase Realtime Database.

FbRemoteDb Simple access to Firebase Realtime Database. Everything is inside a Bucket, there you can store your items. This is for simplifying the acc

NetGuard provides simple and advanced ways to block access to the internet
NetGuard provides simple and advanced ways to block access to the internet

NetGuard NetGuard provides simple and advanced ways to block access to the internet - no root required. Applications and addresses can individually be

Comments
  • Nothing happened when user didn't install

    Nothing happened when user didn't install "Permission Nanny"

    I think Permission Nanny is a good idea. it will be useful if all developers follow the rules.


    but, nothing happened when user didn't install "Permission Nanny", any toast or dialog are not shown. it will let the user confusion.


    how about show a dialog to show the way to install "Permission Nanny"?

    opened by pcqpcq 2
Releases(v0.1.2)
Owner
null
A liteweight Android application to access your hanger!

星河避难所 这是一个星际公民 Android 客户端,可以简化部分官网操作以及信息查询。 A Star Citizen Android Application. 实现功能 官网登录相关 免代理登录/注册 多账号一键切换 光谱账号一键切换 官网信息相关 玩家个人信息显示 官网玩家查询 舰船信息查询 玩

Kirakira 19 Dec 19, 2022
An app for developers which contains more than 2.4k+ resources , with 1.2k+ free public API documentation

ResourceUp We often spend a lot of time finding good resources to get started with our project right? ResourceUp aims to provide all useful resources

kalp patel 10 Apr 30, 2022
android-delicious Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play.

Delicious Android Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play. Fea

Alexander Blom 137 Nov 20, 2022
MEGA Android Client - A fully-featured client to access your Cloud Storage provided by MEGA

A fully-featured client to access your Cloud Storage provided by MEGA. This document will guide you to build the application on a Linux machine with Android Studio.

Mega Limited 1.1k Jan 3, 2023
Tiny app to monitor permission changes.

Catcher Permission monitor. Tiny app to monitor permission changes. If any app will get INTERNET permission after an update you will get a notificatio

lucky 9 Oct 9, 2022
Source code of JekyllEx Android App which can manage your Jekyll blog directly from your Android device!

JekyllEx Android App Built with ❤︎ by Gourav Khunger ?? Introduction JekyllEx is an Android App that allows you to manage a Jekyll Blog directly from

JekyllEx 24 Nov 8, 2022
A Android app Permissions with Kotlin Flow APIs

Know about real-time state of a Android app Permissions with Kotlin Flow APIs. Made with ❤️ for Android Developers.

Shreyas Patil 281 Dec 30, 2022
A news application through which you can learn and browse all the news that interests you by choosing the country and type of news with the ability to browse and add some news to your favorites

MY-NEWS-Android A news application through which you can learn and browse all the news that interests you by choosing the country and type of news wit

Mahmoud ELramady 0 Nov 11, 2021
An app that is a one-stop destination for all the CS enthusiasts, providing resources like Information scrapping techniques, best YT channels, courses available free-of-cost, etc. & knowledge about every domain and field that exists on the Internet related to Computer Science along with News, Jobs, and Internships opportunities in these domains along with valuable tips and hacks from mentors for a particular domain.

An app that is a one-stop destination for all the CS enthusiasts, providing resources like Information scrapping techniques, best YT channels, courses available free-of-cost, etc. & knowledge about every domain and field that exists on the Internet related to Computer Science along with News, Jobs, and Internships opportunities in these domains along with valuable tips and hacks from mentors for a particular domain.

CSwala 48 Nov 26, 2022
Allows usage of vCard resources with the Android contacts provider

vcard4android vcard4android is an Android library that brings together VCard and Android. It's a framework for parsing and generating VCard resources

bitfire web engineering 7 Dec 15, 2022