Android Pentesting Tools, iOS Lock Screen Vulnerabilities, and Essential Kotlin Tips
In this roundup: ten pentesting tools, iOS lock screen vulnerabilities, bypassing anti-emulator protection, legal ways to elevate privileges in Android, methods to make your app harder to hack, 15 must-have tools for Android developers, useful Android Studio keyboard shortcuts, 31 Kotlin tips, and a fresh batch of handy Android libraries.
Tools
- SnoopSnitch β App for checking your phoneβs firmware for installed and missing security patches.
- uitkyk β Simple Frida script to detect malware by analyzing stack objects and intercepting shell command functions.
- AndHook β Another DBI framework for Android, similar to Cydia Substrate and Xposed.
- androidre β Docker image with a set of Android app analysis tools: Apktool, jadx, APKiD, Radare2, Frida, and more.
- iCloudBrutter β Apple ID password brute-forcer.
- QARK β Automated tool for finding various vulnerabilities in Android apps; can sometimes generate ready-to-use exploits or ADB command sets.
- droidstatx β Utility that generates a mind map with app info and possible vulnerabilities.
- avd-root β Script for rooting the Android emulator.
- bfinject β Utility for injecting libraries into any iOS app; requires jailbroken iOS 11.0β11.1.2.
- bfdecrypt β Utility for decrypting iOS apps; requires jailbroken iOS 11.0β11.1.2.
Bypassing Android Anti-Emulation Protection
Bypassing Android Anti-Emulation, Part I and Part II β a two-part series on bypassing anti-emulator protection. The first part introduces Android app structure and how anti-emulation works. The second part is practical, showing how to decompile an app and disable the protection.
- Most anti-emulation mechanisms rely on reading system variables and searching for certain strings, e.g.,
Build.FINGERPRINT.startsWith("generic")
,Build.MODEL.contains("google_sdk")
,Build.BRAND.startsWith("generic")
. - Disabling anti-emulation is similar to hacking a legit app: decompile with jadx or another tool, find the emulator check (often in functions like
carrierNameFromTelephonyManager()
,isEmulator()
, orsmellsLikeAnEmulator()
), then disassemble with apktool, find the same function call in smali code, and remove it. Obfuscators like ProGuard make this harder, but not impossible.
iOS Lock Screen Vulnerabilities and Mitigation
Full list of iOS lock screen vulnerabilities from iOS 5 to present, with links to descriptions and video demos.
- iOS 5.x β 4 vulnerabilities
- iOS 6.x β 8 vulnerabilities
- iOS 7.x β 12 vulnerabilities
- iOS 8.x β 11 vulnerabilities
- iOS 9.x β 6 vulnerabilities
- iOS 10.x β 10 vulnerabilities
- iOS 11.x β 5 vulnerabilities
Tips to protect yourself from lock screen hacks:
- Disable Siri on lock screen: Settings β Passcode β Siri (or Voice Dial) β Allow access when locked
- Disable Passbook on lock screen: Settings β Passcode β Passbook β Allow access when locked
- Disable Control Center on lock screen: Settings β Control Center β Access on Lock Screen
- Disable notification panel on lock screen: Settings β Passcode β Allow access when locked
- Disable missed calls on lock screen: Settings β Notifications β Phone β Show on Lock Screen
- Disable SMS previews on lock screen: Settings β Notifications β Messages β Show Previews
- Disable lock/unlock with case: Settings β General β Lock/Unlock
- Disable camera on lock screen: Settings β General β Camera
- Set an alphanumeric password
Security of Apps Using ADB Workaround
Analysing Use of High Privileges in Android Applications β a study on the security of apps using the ADB Workaround to gain higher system privileges without root.
Android has normal and dangerous permissions (the latter require user consent), but also system and signature permissions, which allow installing/removing any app, taking screenshots, backups, and more. System permissions are only for pre-installed apps; signature permissions are for apps signed with the firmwareβs key.
However, any process started via adb shell
gets signature-level permissions. Some developers use this by embedding a proxy in their app, which the user starts via ADB or a script. The proxy receives commands from the app and performs privileged actions. Researchers found that these proxies often use hardcoded or insecurely stored passwords, making them vulnerable to malware that could connect to the proxy and, for example, record the screen β all without system-level rights.
Running Java Code with Shell Privileges
Introducing scrcpy β an article about the scrcpy utility, which mirrors your phoneβs screen to your PC and lets you control it with mouse and keyboard. The interesting part is how it works: scrcpy uploads and runs Java code with adb shell
privileges, but not as a regular Android app β just a DEX-packed JAR file.
- Write a Java app (example):
import android.os.SystemClock; public class HelloWorld { public static void main(String... args) { System.out.print("Hello,"); SystemClock.sleep(1000); System.out.println(" world!"); } }
- Compile:
$ javac -source 1.7 -target 1.7 -cp "$ANDROID_HOME"/platforms/android-27/android.jar HelloWorld.java
- Convert to DEX:
$ "$ANDROID_HOME"/build-tools/27.0.2/dx --dex --output classes.dex HelloWorld.class
- Pack into JAR:
$ jar cvf hello.jar classes.dex
- Push and run on device:
$ adb push hello.jar /data/local/tmp/ $ adb shell CLASSPATH=/data/local/tmp/hello.jar app_process / HelloWorld
This way, you get an app that doesnβt need to be installed and has shell rights, allowing privileged actions like backup, screencasting, screenshots, and app management.
Better Obfuscation with ProGuard
Improving ProGuard Name Obfuscation β ProGuard, included with Android Studio, optimizes and obfuscates Java classes by shortening class, method, and variable names. By default, it uses predictable names (a, b, aa, etc.), making it easier for attackers to map code between versions. To make it harder, use different dictionaries for each build:
-obfuscationdictionary method-dictionary.txt -packageobfuscationdictionary package-dictionary.txt -classobfuscationdictionary class-dictionary.txt
Also, use:
-repackageclasses 'o'
This moves all classes into package o
, further confusing attackers.
Kotlin Inline Functions
Demystifying the inline keyword β The inline
keyword tells the compiler to insert the functionβs body at the call site instead of making a function call. This is especially useful for functions that take lambdas, as it avoids creating anonymous objects for each call, improving performance.
- Use
inline
for functions that take lambdas and are called frequently. - Since Kotlin 1.1,
inline
can be used with properties (getters/setters). return
inside a lambda passed to an inline function returns from the calling function, not just the lambda.- There are also
noinline
andcrossinline
modifiers for more control over lambda inlining.
inline fun exampleFun(crossinline body: () -> Unit) { Runnable { body() }.run() }
15 Essential Android Development Tools
- FlowUp β App performance monitor (FPS, memory, CPU, etc.)
- Stetho β Facebookβs debugging tool for inspecting View hierarchy, SQLite DBs, and network via Chrome DevTools
- LeakCanary β Memory leak detection library
- JRebel β Build acceleration system
- Android Asset Studio β Tools for generating app icons and resources
- DryRun β Quickly try Android libraries with a sample app in the emulator
- Vysor β Chrome plugin for interacting with your phoneβs screen
- B4A β BASIC development environment for Android
- Genymotion β Feature-rich Android emulator
- Sourcetree β Graphical Git client
- Takt β FPS counter overlay for apps
- Codota β Android Studio plugin for searching Stack Overflow, GitHub, and Gist
- AIDE β Android IDE as an app
- Android Studio
Useful Android Studio Keyboard Shortcuts
- Ctrl + Shift + A (Cmd + Shift + A) β Quick action search (menu items like Generate signed APKβ¦)
- Ctrl + N (Cmd + O) β Find classes
- Ctrl + Shift + N (Shift + Cmd + O) β Find files
- Shift twice β Search everything above
- Ctrl + Alt + Left (Cmd + [) β Jump to previous code location
- Ctrl + Alt + Right (Cmd + ]) β Jump to next location
- Ctrl + E (Cmd + E) β Recent files
- Ctrl + Shift + Enter (Cmd + Shift + Enter) β Autocomplete
31 Days of Kotlin: Key Tips
Summary of #31DaysOfKotlin β In March, Googleβs official AndroidDev Twitter shared daily Kotlin tips. Hereβs a concise summary:
- Elvis operator (
?:
):val name: String = person.name ?: "unknown"
- String templates:
val text = "$language has ${language.length} characters"
- Destructuring declarations:
val (red, green, blue) = color
when
operator for smart branching- Flexible
for
loops:for(i in 1..100)
,for((index, element) in array.withIndex())
- Properties and fields with custom getters/setters
- Data classes:
data class User(val name: String, val email: String)
- Visibility modifiers:
private
,internal
- Default arguments in constructors and functions
- Sealed classes for advanced enums
- Lazy initialization:
val preferences: String by lazy { ... }
lateinit
for non-null variables initialized later- Argument checks:
require(name.isNotEmpty()) { "Invalid name" }
- Inline functions:
inline fun onlyIf(check: Boolean, operator: () -> Unit)
- Calling Kotlin functions from Java with
@file:JvmName
- Type-safe system services with reified generics
- Delegation for property state management
- Extension functions:
fun String.toUri(): Uri = Uri.parse(this)
- Drawable to Bitmap conversion with Android KTX
- Sequences for efficient data processing
- Operator overloading:
operator fun Spannable.plusAssign(span: Any)
- Top-level functions (no class needed)
- Iterators for ViewGroup and SparseArray with Android KTX
- ContentValues made easy with Android KTX
- DSLs for custom mini-languages
- Bundles simplified with Android KTX
- Lambdas for concise code
- Spannable string building with Android KTX
@Parcelize
for Parcelable data classes- Extended Android API with Android KTX
- Scope functions:
let
,apply
,with
,also
,run
More Tools
- Scrcpy β Simple tool for mirroring and controlling your phone from your PC; requires only ADB, no root.
- Hyperion-Android β In-app debugging and UI inspection tool, similar to browser DevTools.
- Profilo β Facebookβs app performance profiling library.
- Certified Devices β List of Google-certified devices compatible with Google Play.
Useful Libraries
- PhotoEditor β Ready-to-use Paint-style graphics editor View.
- Lynket β Open-source Chrome-based browser for learning how to build your own.
- Json2Kotlin β Converts JSON to Kotlin data classes.
- Kyrie β Enhanced VectorDrawable and AnimatedVectorDrawable classes.
- GlideToVectorYou β Glide-based library for loading and displaying SVG images.
- BottomNavigationViewEx β Extended BottomNavigationView UI component.
- Spark β Gradient animation library in Instagram/Spotify style.
- ShapeOfView β Assign custom shapes to any View.
- ModalBottomSheetDialogFragment β Material Design bottom sheet menu.
- Kotlin Please Animate β Powerful, easy-to-use animation library.
- ElevationImageView β Adds shadow to ImageView.
- Floating Action Button Speed Dial β Speed dial menu for FloatingActionButton.
- android-inline-youtube-view β Embed YouTube in your app.
- convalida β Input field validation library.
- LocaleText β Change app locale without restarting.