1

I was pulling the .apk files from the device using the following command:

./adb pull /data/app/com.example.tracker-1.apk

When I tried using the same command for the encrypted app as below:

./adb pull /mnt/asec/net.stfj.spelltower-1/pkg.apk 

I get the following message

failed to copy '/mnt/asec/net.stfj.spelltower-1/pkg.apk' to './pkg.apk': Permission denied

The device is not rooted and the app is a paid app. The intention of pulling is not piracy but to understand the library and architecture of a set of apps. Is there a way I can retrieve that .apk file?

3 Answers 3

2

You wont be able to pull a "protected app" without root, sorry.

This has nothing to do with the app being payed, except that usually only payed apps are "protected" (theoretically, free apps could be "protected" as well); think of it rather as a kind of "DRM".

Once your device is rooted, you can use "root powers" to pull those .apk files. This can be done either using a specialized app (such as AppMonster), or via adb pull if the ADB daemon runs in root-mode (it usually doesn't, but that can be achieved using adbd Insecure). adb root usually doesn't work on "production devices", so you have to use this different approach.

4
  • So if the device is rooted, will it be the usual way of accessing the .apk? say: ./adb pull /mnt/asec/net.stfj.spelltower-1/pkg.apk or do i need to be a superuser in the shell to pull the data. It will be great if someone can have the steps to achieve this. I read thru a lot of forums. common lines i would see is rooted device, adb shell superuser, adb root Commented Sep 25, 2013 at 7:18
  • Please click the checkmark next to the answer if you count it such :) This and "upvoting" (which you can do as soon as you've got a little more rep) are the StackExchange ways to say "thank you". I will meanwhile update my answer with the requested details.
    – Izzy
    Commented Sep 25, 2013 at 7:35
  • +1 for answer, but is there any legal ambiguity around pulling apk files of paid apps? I assume not but any distribution would be illegal right?
    – RossC
    Commented Sep 25, 2013 at 9:40
  • @RossC Exactly. As long as you pull them "for backup", but keep them to yourself, there shouldn't be any legal claim possible. The "protection" is rather targeted to prevent "sharing": if you cannot get hold of the file, you cannot share it.
    – Izzy
    Commented Sep 25, 2013 at 10:22
0

Unless you want specifically to play with adb, you could use either of these two 100% tested workarounds (each one requires installation of another app, though).


Approach_1: (needs a rooted gadget)


  • download & install a backup/resore app (such as Titanium Backup or AppMonster; free versions will do just fine);
  • backup the app you need;
  • navigate to the /sdcard/TitaniumBackup dir (in case of AppMonster you'll need to look into AppMonster's settings to see its backup data dir) and get your APK from there

Approach_2:


  • install Busybox (in case of factory rooted devices --- on so-called developer phones/tablets --- it'll be there already)
  • download & install a terminal emulator (such as Terminal Emulator by Jack Palevich)
  • run it and type this (don't use $ or #; they are merely shell prompts for your convenience; replace desired_app_name.apk with the real APK name which you'll see listed after running the 'ls' command):

    $cd data/app
    $su
    #ls
    #cat desired_app_name.apk > /sdcard/Download/desired_app_name.apk
    #exit
    $exit
    
  • get your APK from Download dir (of course, you can use another unrestricted dir)

It doesn't matter what apps we are talking about, free or paid.

-1

You need to root your phone to get access to /mnt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .