Reputation: 1537
I know it have been discussed already at some point. But after searching there are still some questions to that topic.
My situation: I have an App A which generates information and stores it in it's internal storage. App B is supposed to access App As information. The point is that App A was designed before considering a need of App B. Also important: App A shouldn't get modified if it's possible.
What I found:
Question to point two: there is written:
For sharing protected files the applications must be signed with the same cert and have matching android:sharedUserId in their AndroidManifest.xml files.
I get the point with the sharedUserId, but what certificate is he refering to?
Question to point three: Is there a way to access the Information of App A if it gets saved with a different Context.MODE ?
I really would appreciate some thoughts of you guys. Thanks.
Upvotes: 2
Views: 2436
Reputation: 1007296
Also important: App A shouldn't get modified if it's possible.
Fortunately for you, that's impossible. Otherwise, everybody could get at App A's data whenever they want.
I get the point with the sharedUserId, but what certificate is he refering to?
That would be the signing key your application is signed with. For production, it would be the signing key you used for the Android Market, for example.
Bear in mind that you cannot change the sharedUserId
of App A without breaking all of your existing users. Google also does not recommend that SDK developers mess around with sharedUserId
.
Question to point three: Is there a way to access the Information of App A if it gets saved with a different Context.MODE ?
Context.MODE
has nothing to do with external storage. Every application can read (and, with WRITE_EXTERNAL_STORAGE
, write) anything they want on external storage.
Context.MODE
comes into play with internal storage (openFileOutput()
). However, if you make the file world-readable, then any application can read that data, not just App B.
Content Provider: to much changes
This, or possibly a service with an AIDL interface, is the best answer, where you use a custom permission to help ensure that only App B can access App A's data.
Upvotes: 1