Redirect to another content provider - android

Everyone knows that Facebook reads user's SMS-content on Android. Me tasked to create fake Content Provider and redirect Facebook to read fake SMS database.
I'm trying to create my own content provider to replace default Telephony on Android, which will handle Facebook's requests separately.
So, there are two questions:
1) Where can i find complete project of TelephonyProvider? Decompilation of TelephonyProvider.apk has no good results.
2) How can i handle requests of specific app separately in content provider?

Me tasked to create fake Content Provider and redirect Facebook to read fake SMS database.
Fortunately, this is not possible, for blindingly obvious privacy and security reasons, unless you control the device firmware.
I'm trying to create my own content provider to replace default Telephony on Android
Fortunately, this too is not possible, for blindingly obvious privacy and security reasons, unless you control the device firmware.
Where can i find complete project of TelephonyProvider?
http://source.android.com.
How can i handle requests of specific app separately in content provider?
You can see if Binder.getCallingUid() returns something that identifies the app that invoked the ContentProvider -- I do not know if that works or not.

Related

How do Google's G Suite Apps share data?

It seems when you download a new Google Suite app for iOS - whether GMail, Inbox, Calendar or whatever - they offer you to log in with your account and already present to you the account you have logged in elsewhere.
The question is both for iOS and for Android.
I know that apps can use Safari or the new Safari WebView (Chrome Tabs in Android) and a permanent cookie to share data between apps. It's a bit clunky, and can be broken by the user deleting cookies. But other than that, it works.
Google seems to be using something else. AdvertisingID? How exactly do they achieve this feat of sharing data on both operating systems?
AppGroup allows data sharing between two different apps or even app and widgets by creating one common shared path (like document directory). Data saved over there can be accessed by any app which is associated with that particular AppGroup. It is an offline data sharing between apps.
Communicating and persisting data between apps with App Groups
On Android:
They probably use Content Providers. As described in this link,
A content provider manages access to a central repository of data. A
provider is part of an Android application, which often provides its
own UI for working with the data. However, content providers are
primarily intended to be used by other applications, which access the
provider using a provider client object. Together, providers and
provider clients offer a consistent, standard interface to data that
also handles inter-process communication and secure data access.
A content provider coordinates access to the data storage layer in your application for a number of different APIs and components, these include:
Sharing access to your application data with other applications;
Sending data to a widget;
Returning custom search suggestions for your application through the
search framework;
Synchronizing application data with your server;
Loading data in your UI.
TL;DR In short, Content Provider is a layer that allows you to share your database with other apps/widgets. So Google Probably has a Content Provider in every app which shares the accounts that have been used on this app.
On iOS:
Now I'm just an Android Developer, but after a quick Google Search, I found this post which talks about UIPasteBoard:
Use the UIPasteboard class to let a user to share data from one place
to another within your app, and from your app to other apps. For
sharing data with any other app, use the systemwide general
pasteboard; for sharing data with another app from your team—that has
the same team ID as the app to share from—use named pasteboards.
I can't assure you that this is exactly the way Google does it. But If I were to implement such thing across my apps, I would use this.

Can be called a custom content provider by default by the operative system?

I want to know if could be possible that your custom content provider could be called by default by the operating system.
For example, if you open the contact app, is possible that in this moment your custom provider could be called and check at this moment?
If this is possible, how can I do this?
Thanks,
Content provider authority names must be unique on the device. Your app cannot even be installed if it has an authority name that matches an existing one, whether the existing one is from another ordinary SDK app or from some pre-installed app. Hence, you cannot replace an existing content provider by "name".
Android does not offer any facility whereby the user could say "for ContentProvider operations for such-and-so content, please use this app rather than this pre-installed app", so the user cannot request to redirect all requests to your provider either.

Android content provider and sqlite database

I'm working on two applications that will share the same data. The obvious solution is to use a content provider. What I'm not clear on is the deployment.
My initial thoughts are that the content provider will be developed as a library and included in each of the apps. I know there are problems with this;
The content provider would be deployed twice and have the same authority. In know the authority could be changed but then you effectively have two content providers.
Sqlite uses the context to determine where the data is stored. So in which app is the data stored? If I delete the app the data will go with it. I imagined it would have some central store but this doesn't appear to be the case.
Over time the content provider may be updated. We could end up with a situation with an updated app using the older content provider.
An alternative to that is to deploy the content provider in one of the apps or in its own app but that then causes a dependency. The apps would have to have the content provider app installed. Not a great user experience.
What is the best strategy for this? Content providers seems to be the right way forward but leaves me with a lot of questions.

What is the equivalent of Android content provider in IOS?

What is the equivalent of Android's content provider in iOS?
Summary:
A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. However, content providers are primarily intended to be used by other applications, which access the provider using a provider client object. Together, providers and provider clients offer a consistent, standard interface to data that also handles inter-process communication and secure data access.
Docs:
http://developer.android.com/guide/topics/providers/content-providers.html
If I'm understanding that link correctly, there is no equivalent.
On iOS, apps can't share resources between each other in that way. For security reasons, each app has it's own data and is sandboxed from being able to access the data within another app.
The only ways you could share data between apps is to have some network sync process between your apps, or possibly use UIPasteBoard but that's cumbersome. You can also pass very limited data via the app URL scheme.
There's a way to share content between apps via keychain if one wanted to in iOS. I think this is the closest I can think of that is equivalent to the content provider in Android.
Good reference here: http://shaune.com.au/ios-keychain-sharing-data-between-apps/
In iOS we can share data between apps having same group id.
[iOS App Group] allows you to share data between between different processes from the same development team
[iOS App Extension] allows you to share common functional

Network Accessibility and Content Providers on android

I recently have gotten very interested in android development. I have this application that needs to be able to store user accounts onto a database. How do I go about making this database network accessible, so users of my application can access their account? I've been looking into this and I think that content providers are one method of solving this problem. However, I don't know anything about content providers so some clarification would be great. Anyways here are my questions straightforward:
How do I go about making a database network accessible so users of my android application can access their account?
What is a content provider and are they free?
Thanks for your time and I appreciate the help.
Good questions, but too broad and open-ended. Also, I find it hard to understand
You have an application that needs to be able to store user accounts onto a database. Where will the database be, on the web or on the device? Do you want to be able to access a web database from the device? Do you intend to store the user accounts on the device?
If you have a web-based database, you have to provide a web server to get data from the database and offer it to your Android app. There are many ways to do this.
A content provider is one of the four main building blocks of an Android app (the others being activity, service, and broadcast receiver). Content providers provide a standard interface between local data and other components, including components in other apps. A content provider can handle files, databases, and even internal data structures you build within the provider, but most content providers encapsulate an SQLite database.
In regard to transferring data between a server and the device, content providers often represent the location of the local data. Content providers don't automatically transfer data, but in conjunction with other parts of Android a content provider simplifies the process of detecting when data has changed.
To transfer data between the device and a server, you'll need to set up your server to provide database data using HTTP, learn how to connect to the HTTP server interface from Android, send requests (I suggest the REST protocol) to access the server, send REST requests to transfer data, and then store the data on the device, probably by using a content provider.
You may also need to learn how to work with user accounts in Android, using the android.accounts.Account class.
Most of these topics are described in detail at the website developer.android.com, which is Google's official Android SDK documentation.

Categories

Resources