[JAVA] [Android] Let's snoop on other people's apps

In my business, I sometimes want to take a look at the competitor's application ~~ snooping ~~ and see the source code, so I will leave it as a memorandum.

Download the Android app installed on your device

#Check if the connection between the PC and device is established
$ adb devices

#Search for the target package
$ adb shell pm list packages -f | grep [Keywords to download]

The keywords to be downloaded are usually caught by entering the company name or the name of the application.

#Example
$ adb shell pm list packages -f | grep yamachita0109
package:/data/app/com.yamachita0109.voice-Q6HZbU2pgLu4T3FCQg74kg==/base.apk=com.yamachita0109.voice

Decomposes the standard output value.

Name value
APK save destination path /data/app/com.yamachita0109.voice-Q6HZbU2pgLu4T3FCQg74kg==/
APK file name base.apk
Application ID com.yamachita0109.voice

download.

#Specify the APK save destination path
$ adb pull [APK save destination path]
#Example
$ adb pull /data/app/com.yamachita0109.voice-Q6HZbU2pgLu4T3FCQg74kg==/
/data/app/com.yamachita0109.voice-Q6HZbU2pgLu4T3FCQg74kg==/: 1 file pulled. 31.4 MB/s (9086342 bytes in 0.276s)

#APK file has been downloaded
$ ls com.yamachita0109.voice-Q6HZbU2pgLu4T3FCQg74kg\=\=/
base.apk	lib

Decompile the APK file

Use jadx.

git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew dist

JDK 8 or higher must be installed:

So be careful.

Finally decompiled.

#OK through Path
$ build/jadx/bin/jadx --log-level error [APK file path]

A folder is created with the APK file name. Since the source code is included in it, you can refer to it ~~ snooping ~~.

Summary

"Sweet !! The folklore of martial arts begins with imitation!"

It is a quote of Akiame, a character of Kenichi, the strongest disciple in history.

"All originality begins with imitation"

It is a quote from Akira Takata, the founder of Japanet Takata.

Recommended Posts

[Android] Let's snoop on other people's apps
Until you start developing android apps on mac
Display View on other apps on Android (Summary of support methods by API version)
[Android] Notes on xml