Skip to content

Static Analysis (SAST)

Static Application Security Testing (SAST) in mobile hacking involves examining the application’s compiled code, resources, and configuration files without actively executing the app on a device or emulator.

The goal is to understand the app’s logic, identify hardcoded secrets, and spot insecure coding practices simply by reading the reversed source code.


Android analysis is famously straightforward because Dalvik bytecode can be almost perfectly decompiled back into readable Java.

  1. Apktool: Used to unpack the APK, decode the AndroidManifest.xml (which is compiled into a binary format), and extract resources. It also disassembles the .dex files into Smali code (a human-readable representation of bytecode).
  2. JADX (Jadx-GUI): The gold standard for decompiling .dex into equivalent Java code. You drag and drop an APK into Jadx, and it provides a highly readable Java source tree.
  3. MobSF (Mobile Security Framework): An automated all-in-one SAST tool that scans the code for common vulnerabilities and hardcoded secrets.
  • Hardcoded Secrets: Developers frequently leave API keys, AWS credentials, or encryption keys hardcoded in string definitions (res/values/strings.xml) or directly inside Java classes.
  • Insecure Data Storage: Looking for code that writes sensitive data to SharedPreferences without encryption, or saves files to the globally readable External Storage (/sdcard).
  • Exported Components: Reviewing the AndroidManifest.xml for Activities, Services, or ContentProviders that have android:exported="true" (or implicitly exported by having an intent-filter) but lack proper permission checks. This allows a malicious app on the same device to trigger internal app functionality.

Static analysis on iOS is significantly harder than on Android. Apps downloaded from the App Store are encrypted using Apple’s FairPlay DRM, and they are compiled directly to ARM machine code (Mach-O binaries), not an intermediate bytecode.

Before you can analyze an iOS app, you must decrypt it. This generally requires a jailbroken device. The app is launched (so the OS decrypts it into memory), and tools like frida-ios-dump or Clutch dump the decrypted memory back into an unencrypted IPA file.

  1. Hopper Disassembler / IDA Pro / Ghidra: Since you are dealing with machine code, you need a disassembler/decompiler to generate pseudo-C code or Assembly.
  2. Radare2 / Cutter: Powerful open-source alternative for binary analysis.
  3. class-dump: A utility for extracting the Objective-C runtime headers from Mach-O files, giving you a roadmap of the app’s classes, methods, and properties.
  • Property Lists (plists): Checking Info.plist for misconfigured Custom URL Schemes, which can be exploited for malicious redirection or parameter injection.
  • Binary Protections: Using tools like otool to verify that the developer compiled the app with standard protections enabled (PIE, ARC, Stack Canaries).
  • Hardcoded Keys: Running strings against the decrypted binary to fish out obvious URLs, tokens, or encryption keys left behind by developers.