Install Apk only once [duplicate] - android

This question already has an answer here:
To protect the apk
(1 answer)
Closed 9 years ago.
I want to make my android app apk to be install only once and it should not run on other device if it is copied from first device.Is it possible to do this in android?
Thanks in advance.

No, it is not possible. Apps can be installed and removed as many times the users want them to. Also our code comes into control only after our application gets installed. Hence we cannot determine whether we are getting installed or removed.

You don't have any way to do that if you want your user to be able to install the application
A possible workaround would be to test the DeviceID, and allow the app to proceed only if the DeviceID has been authorized.
Obviously you would have to manage this in your code, and that could become quite cumbersome if you need to authorize numerous devices. Plus I am not sure every device has a DeviceID
see Is there a unique Android device ID? for more information about this
and even take a look at licensing

Its not possible in android ,By using application signature you can't install same signature app if a same signature app is already there.but you can't restrict it to getting installed in other devices.

Just think about it. The application doesn't know whether it is installed already or not.
If you are using an web based application, then assign a value to the database after the installation. (This value should only be known by the device inserting the value at database)
So when your application open next time on another device check the value and prohibit the user. This is the way you can block it.

Related

How to update an already distributed app without installing a new version

I built a small application that gives real time update on coronavirus cases in my country.
Just recently, the API which I used to get the number of cases, deaths etc changed their endpoints
e.g from
https://covid19.com/corona/country
to
https://covid19.com/v2/corona/country
Due to strict restictions by Google on apps relating to covid19, I couldnt upload to playstore but I built an APK and shared the link to many people to download.
Now, they cant access the number of cases in the app due to a change in the API endpoints.
Please, how do I change just that string URL from my end to have effect on everyone who has the app already without needing to build another apk and making people to download the app again.
I discovered Firebase Remote Config, I tried it on my android studio, run the app on my phone, and yes it was working on my device, but How do I get it to work on other people devices with the app already installed.??
The only option you have is:
If you have put any text field which takes string data dynamically (like from database/server), there you can inform user to download latest version with a short link. But again that depends upon the text view size/scope you have defined.
Since, without updating the app itself by anyway, it seems impossible to make the existing app working.

Install app without asking user

My application will be running on hundreds of android devices belonging to a single owner and I may need to modify the software as an update at some point.
I decided I should include a feature to check with the server for updates and download them, which is currently working.
Installing the update is the difficult part. I need it done automatically. Preferably with no user interaction since there are hundreds of devices and it would be very time consuming to do each one manually.
This is the problem, even with the device rooted, I can not find a generic way that each device can install the update without system specific information.
I have read questions like this but can not find a proper answer: Install Android APK without prompt
The bottom answer executes but I can find no installed app, so I assume it failed.
What you want to do is not possible without some serious hacks. A private app store might be a better fit.
If your client is a Google Apps user, you can create a private channel in the Play Store.
Distribute Android apps in your organization
If not, you will have to rely on third party solution like these one:
Apperian Mobile Application Management
ManageEngine Mobile Device Manager
I didn't try any of these, so you will have to do some research to check that they fit your needs

Is it possible to silently update self on android

I'm building an MDM application for Android devices and I want to be able to silently update the MDM app in order to patch security holes, add new features, etc. I know it is possible to achieve this by accessing the Android Package Manager Installer but from what I can tell this requires the application to be signed with the same signature from a specific OEM.
Is it possible to do a silent update for an MDM application without rooting the device?
You cannot, and this is viewed as a Good Thing from the point of view of the user, because the code that I install cannot be changed by anybody except software signed by a trusted key (such as Google's Play), or with manual approval.
I can think of two workarounds:
Check if there's an update, download it, then refuse to do anything until the user updates the app.
Dynamically load most of your app's functionality at runtime from a JAR that your app downloads. You could silently update this at will.
Heck, you could even combine the two options, so that if the wrapper needs updating, it will bother the user. The second method will make the nags very infrequent.
You should probably let the user know that this is happening, at least in an initial info-screen. I know I would uninstall any app that tried to go behind my back in this manner, if I found out about it.

Imposing Restrictions on the installation of apk

I want to make certain restrictions on distribution of the Android mobile application(apk).
I am currently not uploading the apk to Android market.
I want to provide the apk to the user with the following restrictions.
i> After the Android mobile application(apk) is installed , the application should work for only 5 days.
ii> The apk file cant be reinstalled on the same mobile device more than once.
Is there any way using code by which , I can make the above restrictions?
Kindly provide your suggestions/hints for implementing the same.
Warm Regards,
CB
Anything that you store on the device itself will be removed once the app is uninstalled, so you cannot check for a previous installation. You could hide something away on the SD card, you then cannot legislate for the user wiping their SD card, or swapping SD cards.
I would suggest registering a unique ID for the app installation with a simple web service. You can then interrogate this web service periodically to determine whether the 5 day limit has expired. Even if the user uninstalls and reinstalls the app, 5 day restriction will still be applied.
I think there should be an API which provides you the date when the apk is installed on the device, later we can compare that installation date to the current date and calculate if 5 days have occured or not. this may solve the problem. Sorry but I'm not aware of any such API's to get the installation date, but if the API is found then your problem can be solved. I just suggested a method of doing it. Let me also know if it has worked.

Installing apk from within application in android

I need to downloads and install apk from server to devices and i tried to do this task but it ask for user permission like "Insall" , "Cancel" . and if hits "Install" then it works fine and installed but i dont need this permission as i am to install 30 apk from server .
Thanks in advance .
The security model of android won't let you do such things without user interaction. It could be, if the particular phone was rooted, but I think you can't rely on that.
You can not do this on Android as said because it's a security limitation.
It could be possible if you create a system app but based on your question I think that is not what you are after.
However there is a possible workaround:
If those apps that you are installing are made by you and it is possible to modify them to act like plugins/libraries(Don't worry you can keep the activities and stuff) then you could load them dynamically when your apk is run, thus essentially giving you new code to be run on the device (Elements of these apps will run under same user ID but you can start them in a new process if you want with android:process=":YourProcessName".
Check out this tutorial on how to load external libraries at runtime http://xianminx.blogspot.com/2011/12/dynamic-loading-android-custom-library.html

Categories

Resources