Is it possible to get UserId and password of installed application? - android

Is it possible/ permissible in Android SDK to get UserId and password of installed application (if it has a login)? I need installed application info like Application name, package name, installed date and was wondering if getting login name and password is feasible and allowed by Android.
This question helps to get the required username but this is application-specific. What I want is a generalised solution like if the installed application has a login (username and password) for example Facebook or Gmail or twitter, only then it should return the values.
The same I want to use in iPhone application. Please suggest your perspective on iOS too. I want to clearly mention that I am not sure if this is allowed in Android and iOS.
Also, can AccountManager help me in Android?

Usernames and passwords
iOS
It is somewhat unclear, but I assume that you are talking about getting OTHER installed apps' login information since I don't see why you would need a generalized way of getting your own app's information.
As for the iOS part, this is not doable. Most apps stores passwords in the keychain (like Apple suggests), and there is no way to share a keychain access group with other apps (except if the apps share the same Bundle seed ID, but that is not the case here). The Apple Keychain Services Concepts clearly states that
The iOS gives an application access to only its own keychain items.
The keychain access controls discussed in this section do not apply to
iOS.
Android
I strongly doubt there is a way on Android, but I will leave that for a more experienced Android developer to answer.
EDIT: Since you have not received any other answers I will go ahead and say what I think regarding the Android part as well. Generally speaking, Android does not provide a way of storing credentials the same way as iOS does it. Instead, there are multiple ways of doing it. On their Security Tips site, they state that where possible, username and password should not be stored on the device. Gmail, for example, does not (perhaps unreliable source). If you do store them on there, it also says that
By default, files that you create on internal storage are accessible
only to your app.
App detection
When it comes to detecting apps there are two ways to go about it (this is for iOS):
Checking if a specific URL scheme is supported by the device (and thus the app is installed). This can be done with canOpenUrl:
Comparing the device's currently running processes to known app executable names. This is done with sysctl(). This is a neat way of doing it: UIDevice Category For Processes
For Android, check out this example: How to Get List of Installed Apps in Android.
Conclusion
By design, there is no way to get usernames and passwords in either iOS or Android. There are ways of getting a list of most apps installed on an iPhone. This should also be possible on Android, I provided a link that describes one way of doing it.

You may want to consider OAuth as the vehicle to ultimately accomplish what you are trying to do. All three examples you mention support this:
https://developers.facebook.com/docs/reference/dialogs/oauth/
https://dev.twitter.com/docs/auth/oauth/faq
https://developers.google.com/accounts/docs/OAuth2

Technically speaking, in Android, you cannot find the credentials used for an application until they are stored in some shared location (which leaves a big security hole, so is not done!).
You can find Information like, package name, application name, installation time etc.. using PackageManager. Please refer below code snippet.
PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm
.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages) {
// returns the package name
packageInfo.packageName;
// returns the application name
pm.getApplicationLabel(packageInfo).toString();
// returns the last installation time
pm.getPackageInfo(packageInfo.packageName, 0).firstInstallTime;
}

Related

How to connect a device to a SDK?

I am currently working on a web app dashboard interface, the interface is basically a QA debugging tool, that will allow it's users to run playtest sessions. On my understanding terms, the dashboard connects/registers a game through an SDK key. the SDK key origins are generated in the web app and are used on a panel on Unity that our devs created and it successfully links a game to the web app interface.
I want to include a feature which will enable a user to connect their smartphone or tablet to their user profile in the web app...
Q. How do you connect a device,(a mobile device or a tablet) to the Web app, how do I get a user to register its device on their user profile and which informations should I provide and/or ask a user in order to do so?
notes:
1- I am not a developer, I am a UX Designer, I remembered this website which helped me in the past with some front-end questions and the devs at work are currently unavailable to answer to my endless questions. so I am doing this of my own volition.
2- On my understanding terms, I know that a device is linked via its device ID, which changes from app to app.
3 - if my question is not eligible for this site, please at least refer me to a better source. thank you in advance!
Thank you all !
It sounds like you want a tool to connect to this SDK (is this the Unity SDK?) and create fake game session data.
If that's the case, you'd use the SDK just like the actual game would. The only difference is that you don't want your QA tool getting its own id, but use the id of the game apk on the device? If this is indeed what you need to do the following methods should help:
Method 1: You're sharing various bits and pieces of data between the game and the QA tool
Set up a special permission in the actual game with the protectionLevel = signature (e.g. com.somegame.android.permission.PRIVATE_ACCESS). This documentation page on permissions should be useful
Have a BroadcastReceiver, ContentProvider, or Service in the main game that requires the above permission (Exactly which one you'd use depends on how much data you're sharing).
The QA tool declares a uses-permission element in it's manifest with the permission stated above
Sign both the QA Tool and the Game APK with the same keys
The QA tool and the actual game can now communicate with each other through the means you've provided above
The advantage this method has over the next is that even if you haven't run the game before, the QA tool can trigger the registration process in the game and get the id, without requiring you to actually ever run the game.
Method 2: All you need is the ID
Specify the same sharedUserId in both the actual game and the QA tool's manifest (see here for documentation)
Once the game acquires its id, it writes it to its SharedPreferences (preferrably a named preference file as opposed to the default)
The QA tool can now read the preference file (be sure to use the same name) and obtain the ID. The drawback here is that the game must have run before and saved its id in order for the QA tool to access it.
Method 3: If your game runs in a webview
Use a Javascript interface to obtain the info from the webview
Method 4: If your game runs on the web
Directly use the game APIs to access the id. Retrofit would be a great tool in implementing your API calls.
The wording in your question makes it rather difficult to exactly understand what your goal is. I suggest you consult with your dev to come up with a better problem description.
Best of luck.

Get Info About an Android App

Is there a way to get info on an Android application (e.g., publisher name) if you know the name of the package? I don't see it in packageinfo or applicationinfo.
If what you want is not in PackageInfo or ApplicationInfo, then it is not accessible via PackageManager. For example, "publisher name" is only something that a marketplace like the Play Store knows -- that is not a piece of metadata that a developer needs to put into the APK.
Is there a way to get info on an Android application (e.g., publisher name) if you know the name of the package?
Checkout
1) get application name from package name
2) Find package name for Android apps to use Intent to launch Market app from web questions.
You may get some details using PackageManager and ApplicationInfo. The first one seems to answer that. Hope this is of some use to you.
Whilst the original question turned out to be about how to get the Play Store information for an application, there is often information to be discovered about the app publisher or developer (not always the same thing) by looking at the apk on the device.
For example, the package name is in a reversed domain name form, such as com.google.android.apps.maps, and thus gives you a pretty big clue that this is a Google published application.
Apks also contain certificate(s) which are available via packageInfo.signatures. These signatures are "unregulated" (they are generally self signed) and thus can contain anything so should not be trusted to be truthful, but in practice often give a good indication as to the developer (even to the extent of many of them containing the personal name of the lead programmer of the app!)
You can use an app such as App Detective to see the signatures contained in your device's installed apps.

How to obtain information about downloads, total installation, and active installation from my published android applications programmatically?

I have a few questions regarding android market(Google play). How can I list my published application by accessing from my google account? What I have done so far is using my application package name as a query string to search my application and display all information which I used android market api to do it. Is there another better way to display all my published or installed applications by accessing from my google accounts?
My second question is about detecting number of downloading and installations of my published application. I have found only google analytics so far(for free) which I need to embedded some codes to monitoring my application. Is it possible for me to access those information from android market publish page . I have found that publish page contains information that I need.
Edited: For second question, I would like to obtain statistical information without adding any new code to my application. Is it possible to provide only google account to grant the permission to get those information?
My application is published. If I am using google analytics to monitoring my application do I need to start my counting from zero?
Sorry for my English and my little knowledge about this.
Thanks in advance..
Edited: .. I have found an application, called "analytics" that is what exactly I want to do. But I still cannot figure it out how it works..
The only place you will find this kind of information is on your Developer page. That said, if I were wanting to do what you are, I would put up an app on App Engine that either parsed my Dev page on request, or on a schedule. I mention App Engine as personal preference here, you could obviously use anywhere you can host scripts on.
You can then do what you like with the data you have collected, and your app can request this from your site. Assuming you have no qualms with publicising these numbers, you wouldn't need to scare users by authenticating, and would just need a plain html request.
Edit:
In your language of choice, you would need to request your developer page (the one that lists apps and their install count) and would also need to authenticate as yourself to get it. It's for this reason I would use your own hosting if you can. I can't be more specific than this, as I don't know what language you're most likely to be using. It should be trivial to find out how to do an html request and step through the page in whatever language it is though. App Engine pages are written in Java or Python and deployed to the server, while other obvious options are PHP or Perl. On my own server I would most likely use Perl as it's ideal for ripping up html with regexps.

How to restrict an application to only one user

I'm creating an Android application for a fantasy league as part of a college project. It's a paid application, and requires each download to be associated with only one team.
I'm confused as to how best go about it. If a user goes to settings and clears the data from there, all files, settings and databases would be deleted rendering a locally stored indicator for "The app has already run before and hence user is registered" as pointless.
Another option that had come to my mind was to store the IMEI no on a remote database (with SHA1 encryption to protect the data) but the problem with this is that, if a user loses or changes his phone, his further participation would be impossible. Additionally, users understandably don't like to share IMEI numbers and it's acceptable.
The best solution in my mind was to restrict usage of the app to the Google account that was used to download the application. With this, even a change of handsets would allow further participation of the user. However, I've not been able to find a way to obtain the Android Market account (only require E-mail) which resulted in the download.
So, my question is, how do I best go about with the problem that I face? Is there a way to get the Android Market username? Or is there a worthy alternative?
The server-side option is what you want, you can get a unique id from each phone and use that as your identifier.

How to create a license key as a downloadable, and check for it on Android

I'm sure this is fairly basic, but I don't know quite what to search on to get a concise tutorial. I want to create an app and make it downloadable on the Android Market for free. Then, I want to create one or more apps which are just license keys which open up certain functionality on the free app. What's the best way for the free app to check if the paid apps are present on the device? Is there an easy way to check by package name or do I need to create a content provider in the paid apps which the free app can call to check validity?
Or maybe there's some global memory space (like preferences within an app) which all apps can read/write.
I know one solution that would work, and that I could implement easily - have each paid app call a web service when it first starts and register that phone's IMEI. This would work, but requires internet access, which may or may not be convenient for my app.
As with most Android problems - more than one way to skin a cat. I'm looking for what you guys think is the best (and most secure) approach.
One solution would basically to test if your "license" app is still installed on the phone. Then even if the user change phone, he'll still be able to install the license app using his google account.
You can get the list of installed applications using the following code :
List<ApplicationInfo> list = context.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA);
Then just find an ApplicationInfo where the packageName member corresponds to the one of your license app.

Categories

Resources