Marc
Marc

Reputation: 141

Direct download and install of a android apk

I developed a android app which is not in the playstore because its just for internal use. So i made a download page where the user can download the apk. The problem is, after download, the user is not able to install the apk.

Its just possible if the user uses for example "Astro Filemanager". But i found the download page from the amazon app store apk: https://www.amazon.de/gp/mas/get/android/ref=mas_rw_ldg and if i download the apk i can install it directly with a click in the download notification.

So i tried the find out what the differences between my apk and the amazon apk is. So i used "aapt dumb badging {pathToAPK}" to check the 2 files.

The Amazon File:

package: name='com.amazon.venezia' versionCode='638000510' versionName='release-8.0005.557.1C_638000510'
sdkVersion:'8'
targetSdkVersion:'17'
uses-permission:'android.permission.GET_TASKS'
uses-permission:'android.permission.READ_LOGS'
uses-permission:'android.permission.INTERACT_ACROSS_USERS_FULL'
uses-permission:'com.amazon.mas.client.GLOBAL_BROADCAST'
uses-permission:'android.permission.INSTALL_PACKAGES'
uses-permission:'android.permission.DELETE_PACKAGES'
uses-permission:'com.android.amazon.dcp.ota.permission.INSTALL_PACKAGES'
uses-permission:'com.amazon.mas.client.install.CONTENT_PROVIDER_WRITE'
uses-permission:'com.amazon.mas.client.install.INSTALL'
uses-permission:'com.amazon.mas.client.install.KICKOFF_INSTALL'
uses-permission:'com.amazon.mas.client.install.RECEIVE_INSTALL_STATE'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.WAKE_LOCK'
uses-permission:'com.amazon.inapp.purchasing.Permission.NOTIFY'
uses-permission:'com.amazon.device.iap.physical.Permission.NOTIFY'
uses-permission:'com.amazon.mas.client.authentication.permission.DEREGISTRATION_BROADCAST_PERMISSION'
uses-permission:'com.amazon.mas.client.CONTENT_PROVIDER_READ'
uses-permission:'com.amazon.mas.client.malware.blockedapp.BLOCKED_APP_PROVIDER_WRITE'
application-label:'Appstore'
application-label-ja:'Apps'
application-label-de:'App-Shop'
application-label-zh:'亚马逊应用商店'
application-label-en:'Appstore'
application-label-fr:'App-Shop'
application-label-es:'Tienda Apps'
application-label-it:'App-Shop'
application-label-pt:'Appstore'
application-label-fr_CA:'Appstore'
application-icon-120:'res/drawable-ldpi/icon.png'
application-icon-160:'res/drawable-mdpi/icon.png'
application-icon-240:'res/drawable-hdpi/icon.png'
application-icon-320:'res/drawable-xhdpi/icon.png'
application-icon-480:'res/drawable-xhdpi/icon.png'
application: label='Appstore' icon='res/drawable-mdpi/icon.png'
launchable-activity: name='com.amazon.venezia.Venezia'  label='' icon=''
uses-library-not-required:'com.amazon.webview'
uses-library-not-required:'com.amazon.dcp.contracts'
uses-library-not-required:'com.amazon.dcp.contracts.framework'
uses-library-not-required:'com.amazon.client.metrics.api'
uses-permission:'com.amazon.dcp.metrics.permission.METRICS_PERMISSION'
uses-permission:'com.amazon.dcp.config.permission.DYN_CONFIG_VALUES_UPDATED'
uses-permission:'com.amazon.dcp.settings.permission.READ_SETTINGS'
uses-permission:'android.permission.GET_ACCOUNTS'
uses-permission:'android.permission.USE_CREDENTIALS'
uses-permission:'android.permission.MANAGE_ACCOUNTS'
uses-permission:'android.permission.AUTHENTICATE_ACCOUNTS'
uses-permission:'com.amazon.identity.auth.device.perm.AUTH_SDK'
uses-permission:'com.amazon.identity.permission.GENERIC_IPC'
uses-permission:'com.amazon.dcp.sso.permission.USE_DEVICE_CREDENTIALS'
uses-permission:'com.amazon.dcp.sso.permission.EXPIRE_ACCESS_TOKEN'
uses-permission:'com.amazon.dcp.sso.permission.account.changed'
uses-permission:'com.amazon.dcp.sso.permission.MANAGE_COR_PFM'
uses-permission:'com.amazon.dcp.sso.permission.CUSTOMER_ATTRIBUTE_SERVICE'
uses-permission:'com.amazon.identity.permission.CAN_CALL_MAP_INFORMATION_PROVIDER'
uses-permission:'amazon.permission.COLLECT_METRICS'
uses-permission:'android.permission.ACCESS_WIFI_STATE'
uses-permission:'android.permission.READ_EXTERNAL_STORAGE'
uses-implied-permission:'android.permission.READ_EXTERNAL_STORAGE','requested WRITE_EXTERNAL_STORAGE'
uses-feature:'android.hardware.wifi'
uses-implied-feature:'android.hardware.wifi','requested android.permission.ACCESS_WIFI_STATE, android.permission.CHANGE_WIFI_STATE, or android.permission.CHANGE_WIFI_MULTICAST_STATE permission'
uses-feature:'android.hardware.touchscreen'
uses-implied-feature:'android.hardware.touchscreen','assumed you require a touch screen unless explicitly made optional'
uses-feature:'android.hardware.screen.portrait'
uses-implied-feature:'android.hardware.screen.portrait','one or more activities have specified a portrait orientation'
main
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'ja' 'de' 'zh' 'en' 'fr' 'es' 'it' 'pt' 'fr_CA'
densities: '120' '160' '240' '320' '480'
native-code: 'armeabi'

And my File:

package: name='mypackage' versionCode='41' versionName='5.1'
sdkVersion:'8'
targetSdkVersion:'17'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.READ_PHONE_STATE'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.GET_ACCOUNTS'
uses-permission:'android.permission.READ_CONTACTS'
uses-permission:'android.permission.ACCESS_FINE_LOCATION'
uses-permission:'com.google.android.c2dm.permission.RECEIVE'
uses-permission:'mypackage.permission.C2D_MESSAGE'
application-label:'Just for fun'
application-label-da:'Just for fun'
application-label-nb:'Just for fun'
application-label-de:'Just for fun'
application-label-he:'Just for fun'
application-label-se:'Just for fun'
application-label-fi:'Just for fun'
application-label-en:'Just for fun'
application-label-fr:'Just for fun'
application-label-es:'Just for fun'
application-label-it:'Just for fun'
application-label-pt:'Just for fun'
application-label-iw:'Just for fun'
application-icon-120:'res/drawable-ldpi/icon_android.png'
application-icon-160:'res/drawable/icon_android.png'
application-icon-240:'res/drawable/icon_android.png'
application-icon-320:'res/drawable/icon_android.png'
application: label='Just for fun' icon='res/drawable/icon_android.png'
launchable-activity: name='mypackage.MainActivity'  label='Just for fun' icon=''
uses-feature:'android.hardware.location'
uses-implied-feature:'android.hardware.location','requested a location access permission'
uses-feature:'android.hardware.location.gps'
uses-implied-feature:'android.hardware.location.gps','requested android.permission.ACCESS_FINE_LOCATION permission'
uses-feature:'android.hardware.touchscreen'
uses-implied-feature:'android.hardware.touchscreen','assumed you require a touch screen unless explicitly made optional'
uses-feature:'android.hardware.screen.portrait'
uses-implied-feature:'android.hardware.screen.portrait','one or more activities have specified a portrait orientation'
main
other-activities
other-receivers
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--' 'da' 'nb' 'de' 'he' 'se' 'fi' 'en' 'fr' 'es' 'it' 'pt' 'iw'
densities: '120' '160' '240' '320'

But i have no idea was the difference is. My file is signed with our key.

Upvotes: 3

Views: 5796

Answers (2)

Marc
Marc

Reputation: 141

Ok. I guess i fixed it. The problem was the mime-type of the download. I changed it from force-download to application/vnd.android.package-archive and now it works.

Upvotes: 1

GaidinBDJ
GaidinBDJ

Reputation: 46

There may be an alternative to trying to handle the download, install, and updating of an app yourself. The Google Play Store allows alpha and beta versions (without having a production version) of an app which is only available to a select group of people (defined by a Google+ circle or Google Group). You'll still have to sign the app and meet some basic requirements for content (e.g. correct icons and graphics), but you can keep a distribution closed. You'll still have the advantages of the Play Store (automatic updates, trusted install source, etc.) but it will be completely invisible to anyone who is not part of the beta group.

The trusted install source will also help get around having to have users manually enable non-Market sources for download and install which may be why users' devices aren't allowing the installation of the app.

Upvotes: 0

Related Questions