1

A while ago, I asked a question which has been deleted by Community

Some Android apps are in fact ebooks. For example, Learn Lisp

Is it possible to convert android app ebook to pdf or some other document file types? Are there apps to do that?

Andrew T. commented that:

For this particular app: get the APK, open it with zip viewer, and browse the /assets folder; they're in HTML files. I can't answer if there's an automated way to convert it to PDF because the content structure will not be the same for other apps.

Firelord commented that

@AndrewT. good approach. You can add certain tweaks and I think it would make a good answer, well at least for some apps, if not for all. In Android, download busybox, get the APK, and then do unzip -l APK_PATH | grep -E "FILETYPE$". If there exists a file with your extension, its path in APK would be listed. If the developer went to lengths to change the extension and hide the file, then this would fail.

My questions are:

  • How can I get the APK file of an app after installing it from Google Play?

  • Once I find the APK file of an app, can I copy it out of my android phone to my Ubuntu laptop and then extract the hidden document file in the apk file? Or do I have to extract on my android phone?

Thanks.

4

How can I get the APK file of an app after installing it from Google Play?

Multiple ways, but the easiest one, I suppose, is to install a backup type app such as App Backup Restore. Take the backup of the the target app and its APK would be saved inside a directory under the default storage (/sdcard).

Once I find the APK file of an app, can I copy it out of my android phone to my Ubuntu laptop and then extract the hidden document file in the apk file? Or do I have to extract on my android phone?

An APK is an archive (MIME type: application/zip). You can copy it to your laptop alike any multimedia file.

As for the extraction of the contents, there are multiple apps on Play Store which supports extracting a ZIP file, so it is up to you to extract the app on Android or in your PC to explore its contents.

3

Connect your phone to your desktop with usb. make sure your desktop have the adb utility and a suitable driver for your phone is installed.

  1. adb start-server ; adb devices ##make sure device is connected.
  2. adb shell pm list packages|grep -i "keyword" ##get the package full name, eg,my phone will get "package:com.sonyericsson.music" by running in powershell>> adb shell pm list packages|grep -i music
  3. define the package's path "package:/data/app/com.sonyericsson.music-2/base.apk" by shell>> adb shell pm path com.sonyericsson.music
  4. find the base.apk file in your working dir after running in shell>>adb pull /data/app/com.netease.cloudmusic-1/base.apk.

As the other guys say the apk file is actually a zip file, the extracting procedure seems easier.

  • Notice that adb pull expects two args, in the form adb pull file/to/pull computer/location/to/place/it/in. – Death Mask Salesman Oct 3 '16 at 12:51
  • if the dst folder is not provided, it defaults to the working dir. – robertshare Oct 4 '16 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.