I was making an application in which I wanted to add a feature to send apk files via bluetooth. Its not allowed through the traditional method as apk is restricted file type so i used BluetoothShare.java. Apparently it doesn't work on Jellybean. I get a nasty security Exception. Same as this one. Android bluetooth print stopped working on 4.1
Is there any way I can go about doing this, if possible?
I was able to get a stock Nexus 7 running 4.4.2 to send APKs by changing the MIME type in the
Intent
toapplication/zip
. But this still didn't change the block on receiving APKs. But since many/most ROMs remove that block, it is still useful to be able to send APKs from stock ROMs.This is a simple example because it only targets the one Bluetooth
Activity
that I see on my two devices (com.android.bluetooth.opp.BluetoothOppLauncherActivity
). Unfortunately, the Activity not always called that (for example,com.broadcom.bt.app.opp.OppLauncherActivity
), and even the package name can be different (for example,com.mediatek.bluetooth
).Here's how to handle that:
rename the .apk to .zip and send it, then rename it back to .apk on phone.