Simply and easily download an APK file from the Google Play store.
Add this line to your application's Gemfile:
gem 'apk_downloader'
And then execute:
$ bundle
Or install it yourself as:
$ gem install apk_downloader
You first must configure the gem:
ApkDownloader.configure do |config|
config.email = '[email protected]'
config.password = 'password'
config.android_id = 'abc123'
end
An android_id
can be gotten from any Android device by dailing *#*#8255#*#*
. This will bring up the "GTalk Service Monitor", and you can find the ID as a hex string after aid:
.
The email and password provided must be valid Google Account credentials, and they must have been added to the device you got the ID from.
Then simply call ApkDownloader.download! '<package name>', '<destiation file>'
.
This gem works by way of spoofing a series of requests to the private Google Play API (normally only available to the Play store app) by pretending to be an Android device running that app. This is – as far as the API is concerned – a real app purchase request from the configured device/account, which means that in addition to downloading locally to the file you specify in the download!
call it will also automatically download on that device.
I've only ever tried this for free apps. I have no idea what will happen if you attempt to download a non-free app with this gem.
Note also that doing this sort of API request spoofing is explicitly against the Terms of Service for the Play store. You use this gem at your own risk! Neither I, my employer, nor any contributers to this code will be held responsible for any repercussions taken against your accounts or devices from using this gem.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request