Android APK Inspecting / Decompiling
- Pull the APK off the phone
- You could use a dev tool, Titanium Backup Pro, or something simple like "APK Extractor"
- Send to yourself, sync via Dropbox, or transfer via USB
- You have two options for getting readable content
- A) Use an online decompiler, like this one
- B) Manually process the APK, by hand
- First, unpack the archive (
.apk
), using something like Peazip.- Depending on how the APK was produced, you might have readable content right away, or you might need to keep going through steps
- If the
AndroidManifest.xml
appears garbled, it probably was converted to a binary asset before packaging.- If you have the Android SDK tools already installed, you can use
aapt.exe dump xmltree {APK_PATH} AndroidManifest.xml > manifest_dump.txt
to get extracted values
- If you have the Android SDK tools already installed, you can use
- Many XML files might appear garbled, due to binary asset conversion
- You can use Apktool (see below) to extract
- You could also keep using
aapt
, but that is not going to produce clean XMLaapt.exe dump xmltree {APK_PATH} {ASSET_PATH} > asset_dump.txt
- First, unpack the archive (
- C) (Best option) - Process APK with Apktool
- Instructions here
- Without wrapper script:
java -jar apktool_2.4.1.jar decode {APK_FILE}.apk
- For finding intent strings,
AndroidManifest.xml
is a good place to start
Intents
Generally speaking, Intents in Android are a common way for an app to:
- Request that a specific action be carried out
- Known as a "Explicit Intent"
- "Open this specific app and perform this specific action"
- Request that a general action be carried out
- Known as a "Implicit Intent"
- "Open any image viewer app, based on user preference"
- Request that a message be broadcasted across the system.
- Pass intent to
sendBroadcast()
orsendOrderedBroadcast()
- Details: See "Broadcasts overview"
- Pass intent to
Intents are great for automation, because they offer an easy way to "listen" for signals from the system (OS) and applications, as well as triggering actions to be executed
OS Level Intents
The Android Operating System itself broadcasts (and relays) many intents as it runs. For example, android.intent.action.ACTION_POWER_CONNECTED
is broadcasted when the phone is plugged into a power source (e.g. wall charger).
I have found it difficult to find a complete list of all Android OS intents that are broadcasted, but here are some good starting spots:
- Most complete, and up-to-date: AOSP-mirror AndroidManifest.xml
- Comprehensive, but out-of-date: android-autostarts Actions.java
Rooting / ROM Info
Moto G (First-Gen 4G) (xt1045) (aka Peregrine)
- Quick reference - LineageOS page
- Boot menu:
Volume Down
+Power
- ROM install instructions (could be used for any ROM)
- Boot menu:
- Good ROMs
- The stock ROM is still good
- Custom ROMs: LineageOS is probably the best, but you should also probably stay at version 16 (Android 9.0) or below
- Main ROM thread at XDA
Automagic App
JitPack
If you are trying to get actual files off JitPack, perhaps to compare the size of dependencies before adding them or auditing source code, you can use the following pattern for Github:
https://jitpack.io/com/github/${USER}/${REPO}/${VERSION}
For example,
https://jitpack.io/com/github/canhub/android-image-cropper/3.1.0/
This will get you a file list, which you can then traverse and download if you want to.