3

I would like to reverse engineer and ultimately patch an application on my Amazon Firestick. To doo this, I want to analyze the app executable.

I believe third-party apk's are stored in the /data directory but this directory is not readable on an unrooted device. I've also considered dumping the process memory while the app is running, but I believe this would also require rooting the device. I would prefer to not root the device if possible but I understand that might be necessary.

Does anyone know of a way I can get the application binary without rooting the device?

2
  • All rooting does is get you access to the root account. If you want to do anything that you're not explicitly allowed by e.g. the file's permissions, you're going to need to root it. This might not even be hard or even unsupported, necessarily; there are plenty of consumer devices (besides the obvious ones) that are meant to be rootable, especially for developers. You could always dig through Amazon's documentation to see -- maybe have a look at their developer resources? I'd imagine they have some provision for deploying to a Firestick, which might have the answers you need.
    – Nic
    Jul 23, 2019 at 18:56
  • I think you're right that I will need to root the device. However, it seems to me that rooting the Firestick is tricky. For my version of the firmware, the most prevalent method involved shorting a circuit on the board. The developer docs only provide options for monitoring resource usage. Jul 23, 2019 at 19:24

2 Answers 2

3

adb shell pm list packages -f should list all of the installed packages, as well as the path to their apk. Find the apk you're interested in, then pull it with adb pull <path>.

e.g.

> adb shell pm list packages -f
....
package:/data/app/com.google.android.dialer-nt9PJ8MFE293dEV61etgIA==/base.apk=com.google.android.dialer
....
> adb pull /data/app/com.google.android.dialer-nt9PJ8MFE293dEV61etgIA==/base.apk
3
  • This doesn't require rooting? Jul 23, 2019 at 19:26
  • I just tried this and it allows me to "download" the directory but it is empty. Jul 23, 2019 at 22:37
  • I added a more specific example. You should be able to pull the apk file itself, not the directory
    – JesusFreke
    Jul 24, 2019 at 18:59
2

I came across this forum thread that had the correct solution: https://forum.xda-developers.com/fire-tv/help/extract-apk-t3674633. The solution was to download ESFile Explorer and backup the app for which I was seeking the APK. I could then run adb pull /storage/emulated/0/backups/app/<my app>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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