Tuesday, November 29, 2016

Extract APK directly from Google Play Store without using any third party service

Earlier, I was using a third party service to get apk for my favorite apps. But I wanted to know how are they actually extracting those apk from Google play.
After some research, I found this way which can help you get apk from official Google Playstore in 5 minutes once you have proper setup.

Pre-install:
1) Install Android studio at https://developer.android.com/studio/index.html While Installation, it will ask path for android sdk, configure that path as per your need.
2) In my case it was like C:\Users\anurag\AppData\Local\Android\sdk1.
3) We are mainly interested in adb.exe which is present inside platform-tools folder of android sdk, so for me the desired adb.exe path was C:\Users\anurag\AppData\Local\Android\sdk1\platform-tools\adb.exe
4) Add adb.exe in your system environment variables so that you can access adb from command prompt directly.

Pre-requisite:
Get your package name:
1) Suppose you are installing "Clash of Clans" from Google Play, your url looks like https://play.google.com/store/apps/details?id=com.supercell.clashofclans&hl=en
2) Here the param value of id is com.supercell.clashofclans, which is also the package name.
3) Hence package name of this url is com.supercell.clashofclans

How to do:

1) Install the apk from google playstore on your smart phone or tablet
2) Make sure you have enabled the USB debugging on your android device. (How to do -> https://www.kingoapp.com/root-tutorials/how-to-enable-usb-debugging-mode-on-android.htm)
3) Now we use the adb.exe which comes along with the Android studio as explained in Pre-Install step
4) Connect your smart phone to your laptop using a usb cable
5) Now you need to extract the package name which is explained in Pre-requisite section. Assume package name is My_Package
6) Open command prompt
7) Type below and hit enter
 adb pull /data/app/MY_Package.apk  
8) APK is extracted on your PC to the directory pointed in cmd.

Complexity:
Once you have the installed sdk tools and enabled usb debugging, it becomes 5 min job to extract any apk.

Reference:
https://www.kingoapp.com/root-tutorials/how-to-enable-usb-debugging-mode-on-android.htm
https://developer.android.com/studio/index.html


4 comments: