I want to make my Android application such that only eligible/allowed users can install or use it.
Like: to set device IMEI of allowed devices in manifest. Or something/anything like this? Or to ask for a device's specific code which should be entered to use the application?
Related
I'm writing a system app for android devices that we supply to customers. We control the firmware and can add apps to the android image, including into the priv-app folder.
One of the requirements for our app is that it is able to reset our device's password. In order for a 'normal' app to do this, android requires that the app is set up as a device administrator.
Is there any way to pre-configure our app as a device administrator for our firmware, or an alternative way of setting a device password specifically for system apps?
A device admin application may set itself as admin using the hidden DevicePolicyManager.setActiveAdmin method. To do this, however, the application needs the android.Manifest.permission.MANAGE_DEVICE_ADMINS permission which requires platform signing.
System permissions by placing this application in /system/priv-app is not required - the permission is of type "signature".
I assume the platform signing is necessary since otherwise, the user must first accept the device admin setting policies.
Once admin, the application may set any policies including setting the password using DevicePolicyManager.resetPassword method.
Hope this helps.
/Marek Pola, Sony Mobile.
Is is possible to make an android app non deletable.. What i mean is, I want to install a app, but I cant remove/ uninstall it. If I want to uninstall it then it should prompt me for password which I would have set during installation of the app.
When I read the docs they tell it can be done using Device Admin, but it doesnt provide security, interms of it doesn't ask the user for the password and deletes if its correct..
Is it possible to make an app such that even if there is a factory reset the app will still be there on the phone ?
Is is possible to make an android app non deletable
No, unless you want to create your own ROM and preload it with your app, just like some manufactures preload their devices with their own software and other bloatware.
No it is possible to restrict any user to delete the app from android device.
As google already maintaining this scenario by using the concept known as Device Management System.
Google Eyeing on apps which are published by the developer / installed or deleted by the user.
Although you can make your own app which will notify your admin that user is trying to delete the app or deleted the app, using Service Intent concept.
Is there any way to build application for a specific unique device?
Suppose I have one android device and I want to create an apk file for that device only, that apk can't be get installed on any another device, is it possible?
You can use the code in this answer to get the unique device ID.
However, you won't be able to use this to restrict Google Play to restrict your app to this device only, instead, as #ThomasK suggests, you can add a check for this specific device id and finish() if it's not the specific device.
You can limit your app installing from play in many ways, but you cannot restrict it to that extent at a configuration level.
No, you can't do that, Impossible
There are two chances for your purpose:
1st:
when the app starts (that means installing IS possible) you could get the MODEL of the device and if it is NOT the device you designed the app for, you could finish() the activity and the app.
getting the model:
String PhoneModel = android.os.Build.MODEL;
2nd:
Afaik there is a possibility to control what devices are forbidden for your app in the Google Play Store maybe there is not only a Blacklist, but a Whitelist for this?
that apk can't be get installed on any another device, is it possible?
I am not sure about this.But you can decide whether to Enable certain feature based on Device.
Like you can programatically check device wifi mac address which is unique to each device.
If it don't match your criteria don't enable the feature.
What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
What is the best way to prevent a user from downloading and installing applications which uses some specific permissions like location and sms.
Write your own firmware, where you replace the normal installer mechanism with one that enforces your desired criteria.
Android SDK applications cannot interfere with application installation.
Is it programatically possible to parse the manifest of an application from the market before it get installed and look for the specific permissions and alert the user?
No, sorry.
However, you can listen for ACTION_PACKAGE_ADDED and examine the newly-installed package via PackageManager, and alert the user at that point. Since nothing of the installed package can run immediately upon the install, I would think that there is a decent chance that your alert will appear before the user tries to use the newly-installed app.
In the future this would be probably something you could do trough Device Administration, but right now limiting application installation based on its requested permission is not included.
One option is this snippet that decompress the apk and extracts the AndroidManifest.xml.
By the way the aapt tool for android runs on the Android OS too. You can get this information using this port
Is it possible to make the application password protected in Android mobile? ie; if a user tries to install an unauthorized application, we shud prevent that. for tht we will have to make some applications password protected. like "LockMe" in symbian.
you can either develop your own system if you have your own database you contact it and check.
I'm not sure you can prevent somebody from pushing an app to their phone but you can look into
preparing app
there are some option like licensing in the android market