Any way an apk deletes itself after it is installed? - android

I have made an app and for testing I want to give it to some friends for trying/testing. But I don't want them to pass it on to others. So is there a way that after installing the apk, the apk deletes itself?

When you install an apk, it is merely copied to the internal storage. Someone could always retrieve it from there easily enough.
There is no way to delete the apk they downloaded to install it, as you don't know where that apk is located on there phone. You could always show a dialog asking them to, or write some code into your app that sets an expiry date after which is stops working (like in the SwiftKey Flow Beta).
However, mostly handing out beta apks is a matter of trust. If you don't trust a tester to keep it private, don't give it to them.

Related

How can I distribute my Android App without deploying on GooglePlay Store [duplicate]

is it possible to create an android application that is meant only for internal use? Basically a private application not meant to be installed by non-approved phones?
If so what is the basic process of deployment? How do you get the app on the employees phone's?
thanks!
The easiest way is to email it to them. Any email with an .apk attachment will get an "Install" button that you can tap to install the app.
Installing from non-market sources needs to be enabled -- which is a bit of a security risk -- but the user will be prompted to turn that on if they need to, and even given a button that will take them right to the appropriate settings page. The whole process is really quite slick. :)
Alternatively, you can copy it to the phone (e.g. after connecting the phone in USB storage mode) and then use a file system app to locate the file and install it.
Emailing it is the easiest way, however.
Edit: I'm assuming you meant private as in "only sent to certain individuals" and you're not actually looking for a method that will prevent the apps from being run on non-approved devices should they end up on one.
There's a proper way to do it now: Google Play Private Channel for Google Apps. You publish app on Private Channel and then send invitations to users. It won't be seen by other users of Google Play.
Option 1
Using Google Play Private Channel is probably the best way, but is useful only for Google Apps users.
Option 2
You can use new Developer dashboard options that let your app be in Alpha or beta phase and is available to only selected google accounts (using groups or google plus circles). Your app can stay in beta indefinitely so not become visible to other users. if you like this method you can also use services like TestFlight.
Option 3
Mail distribution is also ok it's even mentioned in documentation which I find a little bit odd, but I would advise you to use some file storage like Dropbox and just distribute the link to selected people.
Two major ways:
You can either use the non-market application installation method, or adb from a connected PC to install an apk which you distribute as a bare file. The downside is that anyone in possession of the apk can install your application.
Alternatively, you can distribute the application through the android market, but make it require an account on a server you control in order to do anything useful. The upside is that possession of the apk doesn't get an unauthorized user much; the downside is negative ratings from confused randoms, and that you've made your apk very available for interested parties to know about and decompile. (There is or was also a way to put an app on the market but not list it so it was only accessible via a full url, however don't rely on that)
Yes. As of right now I use such a method, I have to manually load the app on the phone, however other techniques can be used. Once loaded the app checks the main server to see if it is up to date. If it is not, it downloads and installs the new version of itself.
If you go to your eclipse workspace and go to yours app's folder, in the bin folder assuming you develop with eclipse, you will find a .apk file somewhere in there. Copy it to the phone and then use something like EZ File Explorer (or something like that) to access your android filesystem, click on the .apk and it will install and be ready to use.

Tracking Application Install Referral With APK

I have an application using which anyone can share the apk of the app itself. The APK will be generated using PackageManager class like this:
File file = new File(packageManager
.getApplicationInfo(packagename, PackageManager.GET_META_DATA)
.publicSourceDir
)
I need to track (deep link or some other way), who installs the app and who sent the referral? At first, it seemed infeasible to me. Then I came to know that chinese apps like Helo and WeLike actually do so. I gave it a try.
When we share the application from inside of it (have no idea how they generate APK, but the method is probably the same since I have checked they are not getting the APK from remote server and APK size is 40 MB and App Size is 40 MB so they mustn't be storing the APK in the package itself), the person who installs that APK is given the referral prize and relevant information like who referred is shown.
How is this possible? I would like to know any possible way.
In short, how can I track APK installs just with an APK file and no link (but includes generating APK from app ofcourse).
Not sure how Help and WeLike are doing it.
But it seems what you are looking for is Firebase invites, which has been deprecated but firebase dynamic links should have the same functionality (as mentioned in the firebase invite page).
I think most easiest solution to share the APK is by downloading the modified(including the user specific referral tacking code) version of the APK in background, once ready then user can share the version easily without waiting for it.
So you can say, user have the app installed.
user use the app normally, meanwhile you can download the modified APK with
user identifier
Once downloaded, the APK can be shared any number of times with the user
tracking.
Alternatively you can prepare the APK within the App, that may take more effort and complexity.

Can an Android app auto-upgrade itself?

The device my Android app is running does not have Playstore on it. The plan is to pre-install the software when shipping the device. I am now looking for a strategy to upgrade the application.
I found this useful link to install an Android app from the apk file:
Android: install .apk programmatically
I am thinking I will use this logic to auto-upgrade my app. I am wondering if it is even possible. I am thinking the upgrade will first try to uninstall existing version but will fail as the executable is still running and the file may be locked. Is there a better way? Regards.
Peter, we've just implemented the same thing.
Users have the software pre-installed on their device and we host update APK's on the companies servers.
From the app they can then check for updates where we have a WCF service which extracts the APK file (essentially a .zip) and returns the manifest details. From there we have the version of the APK and can compare it against the local version.
If the user decides to upgrade they can download the APK and you can automatically launch it. At which point the user will be told the application is going to be updated. There are no file locks etc, the app will just close and restart using the new version.
Note: Downgrading is not "automatic". The user would have to first uninstall the app. For upgrades, however, it's a simple case of downloading and launching the APK version (the user will be told they need to allow installations from unknown sources if this is not checked).
You have a couple of options, depending upon your target system.
Use the link you posted. This will provide the user with a traditional install dialog, whereby the user can choose to install or not. You should avoid doing that automatically, as APKs can be large and you might irritate the user if they don't want updates.
You can install updates magically, but you will require the firmware signing key (or possibly root, but I haven't tested that). That will not ask for consent from the user. You will need to add additional code using reflection to access the installation methods of Android. If you go this way, you should build an opt-out/in mechanism.
If your app is open-source, F-Droid would solve the problem for you.
F-Droid is an installable catalogue of FOSS (Free and Open Source
Software) applications for the Android platform. The client makes it
easy to browse, install, and keep track of updates on your device.
Mainly, it updates your app when necessary. (Or just have a look at its source code for inspiration on how to do it).
Yes but as far as I remember only if you had Root privileges in order to have access to the INSTALL_PACKAGES permission.

How to build an app with an existing apk signature

I compiled a project (that contains a sqlite db) using a pc that I have not access to that no more. People used that and inserted records to the db. I don't have any access to their tablets. I made a mistake and i have sent them the apk was in bin directory. I changed the program, I want to tell them to update their apps but when they try to replace app, android doesn't let them. So i have to sign my apk as same as the signature of the apk i made on that computer.
What should i do ? Thanks for your help.
Expanding on my comments:
There's not much you can really do if you don't have access to the old signature. It sounds like you're talking about the debug signature. As you found out, this varies from machine to machine, and if you don't have access to the old machine, it's just gone.
This is normally a good thing for security reasons. If it was possible to recover your key, anyone could do it. Then they could maliciously modify the app and upload it as a replacement.
As you've also found out, Android won't let you install an update that has a different signature than the currently installed version. If your users completely uninstall the app, they will then be able to install the new one. That's definitely inconvenient, and a customer service headache, but there's not any other way to do it.
Note that the users will lose any databases, etc, that they had in the app. It will act as a fresh install, since that's what it is.
Theoretically, rooted users could back up their old databases/preferences with any number of utilities and restore them later. In practice, even most users that can do this won't bother with it.

Private Android Application deployment/installation?

is it possible to create an android application that is meant only for internal use? Basically a private application not meant to be installed by non-approved phones?
If so what is the basic process of deployment? How do you get the app on the employees phone's?
thanks!
The easiest way is to email it to them. Any email with an .apk attachment will get an "Install" button that you can tap to install the app.
Installing from non-market sources needs to be enabled -- which is a bit of a security risk -- but the user will be prompted to turn that on if they need to, and even given a button that will take them right to the appropriate settings page. The whole process is really quite slick. :)
Alternatively, you can copy it to the phone (e.g. after connecting the phone in USB storage mode) and then use a file system app to locate the file and install it.
Emailing it is the easiest way, however.
Edit: I'm assuming you meant private as in "only sent to certain individuals" and you're not actually looking for a method that will prevent the apps from being run on non-approved devices should they end up on one.
There's a proper way to do it now: Google Play Private Channel for Google Apps. You publish app on Private Channel and then send invitations to users. It won't be seen by other users of Google Play.
Option 1
Using Google Play Private Channel is probably the best way, but is useful only for Google Apps users.
Option 2
You can use new Developer dashboard options that let your app be in Alpha or beta phase and is available to only selected google accounts (using groups or google plus circles). Your app can stay in beta indefinitely so not become visible to other users. if you like this method you can also use services like TestFlight.
Option 3
Mail distribution is also ok it's even mentioned in documentation which I find a little bit odd, but I would advise you to use some file storage like Dropbox and just distribute the link to selected people.
Two major ways:
You can either use the non-market application installation method, or adb from a connected PC to install an apk which you distribute as a bare file. The downside is that anyone in possession of the apk can install your application.
Alternatively, you can distribute the application through the android market, but make it require an account on a server you control in order to do anything useful. The upside is that possession of the apk doesn't get an unauthorized user much; the downside is negative ratings from confused randoms, and that you've made your apk very available for interested parties to know about and decompile. (There is or was also a way to put an app on the market but not list it so it was only accessible via a full url, however don't rely on that)
Yes. As of right now I use such a method, I have to manually load the app on the phone, however other techniques can be used. Once loaded the app checks the main server to see if it is up to date. If it is not, it downloads and installs the new version of itself.
If you go to your eclipse workspace and go to yours app's folder, in the bin folder assuming you develop with eclipse, you will find a .apk file somewhere in there. Copy it to the phone and then use something like EZ File Explorer (or something like that) to access your android filesystem, click on the .apk and it will install and be ready to use.

Categories

Resources