I have an Android app that uses a WebView to enable users to install applications. Historically, applications installed from Android Market will have the installer value set to "com.google.android.feedback". With Google Play, this value is now "com.android.vending".
This value can be obtained by:
PackageManager pm = context.getPackageManager();
String installer = pm.getInstallerPackageName(pname);
The apps installed by my WebView have an installer value set to null. How can I set my own installer value, such as com.mydomain.store
?
While this doesn't strictly answer the question to do this programmatically, it's also possible to set the vendor package through adb without needing it to be signed with the same key.
There's a complete explanation here, but it boils down to:
The following adb trick sets the install vendor of a debug app:
adb push app.apk /sdcard/app.apk adb shell pm install -i "com.android.vending" -r /sdcard/app.apk adb shell rm /sdcard/app.apk
To confirm that this has worked, list the packages using the Package Manager:
adb shell pm list packages -i [packagename]
If all has gone well, you should see this output:
package:[packagename] installer=com.android.vending
You could try using setInstallerPackageName
.
But you would have to set the installer package name after the package is installed, and the installer package name would have to be empty/null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With