Firefox for Android content provider? - android

Can somebody give me an example on how could I use the Firefox for Android content provider for getting a list of the links in my app history?
Thanks!

Firefox's ContentProvider is not accessible to third party applications. Here is the permission declaration from the manifest:
<permission android:name="#ANDROID_PACKAGE_NAME#.permissions.BROWSER_PROVIDER"
android:protectionLevel="signature"/>
A protectionLevel of "signature" means that the permission is only available to apps that are signed with the same key. Unless they change this, there's no way for your app to access the ContentProvider.

Related

ACCOUNT_MANAGER - "Permission is only granted to system apps"

I am following the instructions found here at android developer. These instructions say to add these two lines of code into the manifest:
<manifest ... >
<uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
The problem is that I now get an error on the "ACCOUNT_MANAGER" line saying "Permission is only granted to system apps".
My application is not going to be a system application and I need to authenticate to OAuth2 services. How can it be possible that ANY app that uses OAuth2 needs to be a system application?
Does anyone know how to use ACCOUNT_MANAGER without requiring my application to be a "system application"?
I've looked at this question and this question. They say that, for the permissions they have listed, the error is a "fake" error message. Does anyone know if the 'ACCOUNT_MANAGER error is a fake message? Can I tell the compiler to ignore this like the suggestions in these other posts?
From documentation
String ACCOUNT_MANAGER
Allows applications to call into AccountAuthenticators.
Not for use by third-party applications.
ACCOUNT_MANAGER permission can only be granted to system app
If your app requires AccountManager, you can create an AccountAuthenticator service like in this tutorial
Or you can request MANAGE_ACCOUNTS permission as explained in this answer
MANAGE_ACCOUNTS: The API documentation is not that clear about this
permission. But according to Bryans answer, an app can only
delete/modify an account it created itself. Of course it can create
any new account, and manage that.

Google Drive API Manifest Permissions

this isn't really a big problem. I've got an Android App that stores user's passwords on a SQLite Database. So last week I launched an update that allows the user to export those passwords to their Google Drive. To do this, I've used the Google Drive Android API. I didn't add any special permission to the Application Manifest (AndroidManifest.xml) and it works fine (tested on KitKat4.4). But one of my friends told me that it might not work on Android 6.0+, because I should always ask for permissions. But I checked some samples and none of them had those permissions on the Manifest. Do you guys think it's necessary to add permissions? Perhaps INTERNET or GET_ACCOUNTS?
If you are using the Google Drive Android API you don't need INTERNET or GET_ACCOUNTS permissions.
The API automatically handles previously complex tasks such as offline access and syncing files. This allows you to read and write files as if Drive were a local file system.
Check the official Quickstart and the demos sample on GitHub. None of them is having special permissions in the AndroidManifest.xml.
BUT if you are using the Google Drive REST API for Android then you need INTERNET permission for sure.
If you follow the tutorials on Drive API using Android, you will see in the Step 4:Prepare the project that you need to add the permissions below in your code.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
The permission "android.permission.INTERNET" is used if you want your application to connect/perform network operation.
For the "android.permission.GET_ACCOUNTS", it's stated in this documentation that:
Note: Beginning with Android 6.0 (API level 23), if an app shares the
signature of the authenticator that manages an account, it does not
need "GET_ACCOUNTS" permission to read information about that account.
On Android 5.1 and lower, all apps need "GET_ACCOUNTS" permission to
read information about any account.
For more information about different meaning/uses of android permission, check this page.
According to the Google Maps API documentation, INTERNET and ACCESS_NETWORK_STATE permissions will be automatically merged to project's manifest, meaning you don't have to specify them by yourself as long as calling API over Google Play services.
Couldn't find the same description for Google Drive API, though.

what is diffrence between android permissions and uses permission using in android services?

how to use android permission and usepermission for services?
I used android uses-permissins ,but i dont know how to use android permission in android development
<uses-permission> is when your application is seeking the user's permission to use some
<permission> is when your application is requiring other apps to seek the user's permission to use some feature of yours.
Usefull links:
permission
uses-permission
The "permission" tag declares a security permission that can be used to control access from other packages to specific components or features in your package (or other packages).
The "uses-permission" tag requests a "permission" that the containing package must be granted in order for it to operate correctly.

Android Map V2 - Why MAPS_RECEIVE permission

Consider this as a wiki question.
While I setup my project to support Map V2, There has been a step to add MAPS_RECEIVE permission.
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
Why we creating and consuming the permission from the app itself?
Is that google play services app interact using this permission ?
This permission can't takes care of these things?
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
I thought the use of custom permission is to allow other apps to launch/use our app's services/resources.
For future visitors:
This permission is now completely unnecessary. The latest update of
Google Play Services 3.1.59 made it useless. As a result, it can be
removed.
source
This is the same pattern you see when using Google Cloud Messaging (GCM) with its C2D_MESSAGE permission. The idea is to protect an endpoint in your application (e.g. a broadcast receiver) so that some other component (presumably part of the Maps API) can contact it securely (otherwise, another application could impersonate your application by using the same intent filter).
In this case, then, Maps API internally sets up such an endpoint (transparently to you) and can, with the use of this permission, that this endpoint cannot be impersonated (because to do so would require the permission, which is protected by your application signature).
This permission specifies your package name.
i.e.
<permission
android:name="package_name.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="package_name.permission.MAPS_RECEIVE"/>
thus, the google API simply allows your project to recieve the map.
The permission tells where to use the API.
I found that this permission is still needed when using the debug certificate. When I exported and signed my application it worked fine, but it wouldn't work when I used the debug cert. I have the MD5 for both my debug cert and application cert associated with the same key. When I finally added these extra permissions, it worked. I am using a Moto X running 4.4 with everything up to date.

Android permissions, signature and the developer's key

I am developing an application which has a number of components, each component will be a separate Android app. The "Core" app will use content providers to offer access to the database, and reading the permissions documentation "Signature" protection is the way I want to go.
I've defined a group for my permission, mainly so my permissions would show up nicely against my own icon in the "Permissions" section of the App Info. with android:protectionLevel="normal" they show up just fine. But when I use the android:protectionLevel="signature" they disappear.
<permission-group
android:name="com.example.permissions.GROUP"
android:label="#string/lblGroup"
android:description="#string/descGroup"
android:icon="#drawable/ic_menu_permissions_group" />
<permission
android:name="com.example.permission.CONFIG_READ"
android:permissionGroup="com.example.permissions.GROUP"
android:protectionLevel="signature"
android:label="#string/lblConfigRead"
android:description="#string/descConfigRead" />
<permission
android:name="com.example.permission.CONFIG_WRITE"
android:permissionGroup="com.example.permissions.GROUP"
android:protectionLevel="signature"
android:label="#string/lblConfigWrite"
android:description="#string/descConfigWrite" />
Given that I am currently developing and, therefore using the developers key, are there some other hoops I need to jump through in order to get the "signature" protection level to work for developers?
As always many thanks for your help
Steve
But when I use the android:protectionLevel="signature" they disappear.
That is because the user does not need to approve them. Signature-level permissions are automatically granted and denied based upon the signatures of the apps.
are there some other hoops I need to jump through in order to get the "signature" protection level to work for developers?
It already works, for your own apps. If "developers" are third parties, you cannot use signature-level permissions, as they will be signing with their own signing keys.

Categories

Resources