Use 3rd-party apps from an intent - android

I wanted to use a 3rd-party app with an intent but application is not installed on user's device. Something like Android Instant Run but apk are included in application or If it isn't possible, How can I install apk on user's? However can I install application silently without Package Installer?
I'll be appreciated if anybody answer my questions.

I wanted to use a 3rd-party app with an intent but application is not installed on user's device.
Ask the user to install it.
Something like Android Instant Run but apk are included in application
Nothing like that exists, sorry.
However can I install application silently without Package Installer?
Fortunately, that is not possible, for security reasons.

Related

Android 4.1.2 permission BROADCAST_SMS

I've been trying to implement an application which sends and receives fake sms on my device (Samsung Galaxy S2, Android 4.1.2). I found an example of such application here:
http://blog.dev001.net/post/14085892020/android-generate-incoming-sms-from-within-your
I copy-pasted it and ran on my device. Nothing happened and I found in logs that BROADCAST_SMS permission was system. I made the app system using Titanium Backup, restart my device and ran the app again. And nothing happened again. I got the same exception that my app had no rights to use BROADCAST_SMS permission. Then I read that I should specify android:sharedUserId="android.uid.system" in manifest. When I added it I failed to run my app using Intellij Idea 14:
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
I tried to install generated by Idea app but got exception: Package has no signatures that match those in shared user android.uid.system; ignoring!
So I have several questions:
1. How is it possible to install unsigned app with android:sharedUserId="android.uid.system" in manifest?
2. Will my app be able to use BROADCAST_SMS permission if I make it system using Titanium Backup or other trick?
3. Is there any other way to force the app work on my device?
I have seen applications which imitate sms incoming. But they all write to inbox directly. I need an application which makes other applications believe that new sms is coming.
Thanks in advance
To use shareduserid your app must have the same signature as all other apps using this uid. Installing the app on /system partition or even giving it priv-app status is not sufficient.
And btw the permission is of level "signature" anyway (not signatureOrSystem) so the only way you can be granted the permission is if your app uses the same signature as the android framework. In other words, you have to make a custom platform build and flash your phone with it.
If you install/build Android from AOSP, a test key is used to sign all the apps. You can use this key to sign your app and install it as a system app. This works great for testing; obviously not going to be an option for something you want to distribute.

Installing an Android apk programmatically

I am trying to install APKs from our file server, and it needs to be done silently without the user being able to choose whether or not it's installed or accept permission settings/changes. This is a legit business requirement as we are working with a device vendor to preload our applications into /system/app. This is a custom Android tablet device, and as such, our business unit want to ensure we can push app updates (i.e. force the latest version).
I understand the usual security restrictions, but there seems to be a mechanism to install applications silently for vendor/manufacture level apps. However the information on how to do this seems very spotty at best.
It seems the package installer must be in /system/app and the installer must have the same signing cert key as the app being installed. That's not a problem, but info on how to implement this feature using this flow is something I have yet to find.
Anyone ever done this before?
I'm fairly certain you'll need to ship them a custom Android ROM that allows you to be able to do this (which I doubt their business will enjoy).
The Amazon App Store on a normal device can't install silently in the background like Google Play can. Maybe the Kindle Fire can do this (I don't own one), but if it can, its because its running on a custom ROM built by Amazon.
The best thing you could do is launch an intent that tells brings the user to the app needs to be updated, which brings them to installer activity, which then requires user interaction.
Not exactly an answer. However, we recently faced similar requirement for an android client-server app.
Whenever the application contacts server with a request, it sends the current versionCode as well.
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
//pInfo.versionCode;
//pInfo.versionName;
On server side we check the versionCode and if we have a new version, informs the client and client forces the user to upgrade to the new version. The client app will not work until it is upgraded to the new version. But obviously user can choose to not install etc.
Hope it helps.

Android APK's Silent Installation

I'm searching for a way to program my application to install silently an APK file.
I'm aware about the possibility to launch with code that looks something like this:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);
But before the installation starts, this code raises a dialog with the APK's required permissions, and needs user authorization to start the installation.
Is there any way to skip this dialog?
Is there any other way to install an application during runtime from my code, that doesn't require user interaction?
No. And that's a good thing - this would be an (other) open door to malware and unwanted installs. Why do you want to do that, if you mind me asking? What's wrong with letting users know that you want to install something on their device?
Also, some details here: Silent installation on Android devices
And finally, this might be possible for rooted devices: if you write your own installer, you can bypass completely the built-in installer, and with root privilege, you can basically do what you want. But I still think that would be a serious breach of security.
Yes you can, but you need root access or your app must be a system signed app.
You can install apps silently by using shell commmand pm install "apk path".
This will definitely work - I have already created a sample app that does this.

How to install multiple apks at a time?

Am developing one Android application which is using thinkfreeoffice.apk for viewing documents in my application. My requirement is I have to download both my application and thinkfreeoffice apks at a time and also install both these apks at a time.
anybody did this one before?
You cannot literally, unless your application is signed with the system certificate or you are using the SDK/ADB install method from a connected PC, or you find and abuse some security bug. As a security measure, any installation done by a normal application on the phone will require the user to go through the confirmation dialog one app at a time.
What you can do is put check in your application for the one it depends on, and keep complaining/downloading/ACTION_VIEWing the downloaded package upon startup of your app until the user either decides they don't want to use your app or agrees with the system install dialogue for the app you depend on.
I think it's impossible to install multiple applications at the same time, as the user has to confirm installation for each apk.
You could of course make the user install your application first, then ask the user to install the office application after which you use an intent to start the installation or redirect them to the Market.
Similar implementations have been used in applications that use third party barcode scanning or speech recognition.

Silent Uninstallation

I am working for manufacture of cell phones. we develop for the Android platform, therefore we can sign our applications and have system permissions, for example we can use
the packagemanager.installPackage(|..) method, which gives us the ability to install APK's without the user involvement.
I would like to know, if any one you know about an Un-instantiation method which would uninstall apk's silently without user-involvement?
thanks,
ray.
There is functionality in there some where to do this - Google uses remote kill switch to uninstall Android apps, but I haven't seen any details on where you would find this. But as a user I would be very unhappy with a handset which silently removed apps without telling me - even if the app was a security threat, if I had installed it, I would want to be told it was being removed.

Categories

Resources