How to Bypass SSL Pinning on Android in 2026

UNDETECTED LABS4 MIN READ
On this page

If you set up a proxy and a system certificate and an app still shows nothing, it almost always pins its certificate. Pinning means the app ships the exact certificate (or its public key) it expects and rejects anything else, so your proxy’s certificate gets refused even though the system trusts it. This is the wall that stops traffic capture on most apps worth looking at.

This is a follow-up to capturing an Android app’s HTTPS traffic. It’s for debugging your own app, auditing one you have permission to test, or reverse-engineering an API behind an app you own.

What pinning looks like in practice

An app can pin in a few places, and where it pins decides how hard it is to remove:

  • OkHttp’s CertificatePinner, the most common on Android. It lives in Java/Kotlin, so a hook that targets that one class usually covers the whole app.
  • A custom TrustManager or HostnameVerifier. Same idea, different class names, so a generic script may or may not catch it.
  • Pinning in native code, compiled into a .so library. No Java method to hook, so the standard scripts miss it and you work at the native level instead.
  • Flutter, which does its own TLS inside BoringSSL and ignores the system entirely. That one is covered in the previous post.

You don’t always know which you’re facing until the easy methods fail, so start with the easy ones.

objection: one command, no scripting

objection runs on top of Frida and wraps the common bypasses. With frida-server running on a rooted device or emulator:

pip install objection
objection -g com.example.app explore

Then at its prompt:

android sslpinning disable

It hooks the usual suspects (OkHttp, the default TrustManager, a few others) and the app’s pinned connections start flowing to your proxy. For an app that pins the normal way, this is the whole job.

Frida with the community scripts

When you want more control than objection, run Frida directly with one of the unpinning scripts. HTTP Toolkit’s frida-android-unpinning covers many cases, and there are well-known pinning-bypass scripts on Frida CodeShare.

frida -U -f com.example.app -l unpinning.js

The script hooks the TLS classes as the app starts and neutralises the pinning check. Most apps that objection handles, a script handles too; the reason to use a raw script is that you can read it, edit it and add your own hooks to it.

When the ready-made scripts don’t work

Some apps pin in a way the generic scripts don’t reach. The app might use an obfuscated class name, verify the certificate in its own method instead of the standard one, or do the check in native code. The script runs, reports success, and the connection still drops.

At that point you write a hook for that specific app. You find the method that does the check (decompile the APK, or trace classes with Frida until you see the TLS code), then replace that method so it returns success:

Java.perform(function () {
    var MyPinner = Java.use('com.example.app.security.CertCheck');
    MyPinner.verify.implementation = function (host, cert) {
        // skip the check, report success
        return true;
    };
});

For pinning compiled into a native library you go a level down and hook the function inside the .so with Interceptor.attach, which takes more digging but works on the same principle. This is the part that turns into real work on a hardened app, and there’s no single script that covers it, because the whole point of custom pinning is to not match the script.

Patching the APK instead of hooking at runtime

Frida needs to run on the device. If you can’t get frida-server onto it, or the app detects Frida and quits (next section), you can edit the app itself instead.

Decompile with apktool, change the part that pins, and rebuild:

apktool d app.apk -o app_src
# edit the smali or the network security config
apktool b app_src -o app_patched.apk

Two common edits: add or relax the app’s network_security_config.xml so it trusts user certificates, or find the pinning method in the smali and make it return early. Then you sign the rebuilt APK (an unsigned APK won’t install) and install that. The downside is that an app checking its own signature or integrity will notice it was repackaged, so this trades one detection problem for another.

Apps that detect Frida

A hardened app looks for Frida and closes before you can do anything. The usual checks are simple: frida-server listens on port 27042 by default, it leaves recognisable strings in memory and named threads, and it drops files under /data/local/tmp. The app scans for those and exits on a match.

A few ways through, roughly in order of effort:

  • Run frida-server on a non-default port and name the binary something else, which defeats the laziest checks.
  • Use Frida Gadget instead of frida-server: you embed the Gadget library in a repackaged APK, so there’s no separate server process or port to find.
  • Hide root and Frida at the system level. On a Magisk device, the DenyList plus Zygisk modules like Shamiko hide root from the app, and an LSPosed module can intercept the specific checks an app makes and feed back clean answers. This is the most reliable route for an app that fights hard, because the app’s own detection calls get answered before they ever see Frida.

Detection and hiding go back and forth. An app adds a new check, a module gets updated to cover it. For a one-off capture you rarely need the heavy modules; for an app that updates often you keep them around.

Where to start

Run objection’s android sslpinning disable first, because for most apps that’s the end of it. If the connection still drops, switch to a Frida script you can read, then add a hook for the app’s own check if the generic one misses. If the app detects Frida, hide it with Magisk DenyList plus Shamiko or an LSPosed module, and if you can’t run Frida at all, patch and resign the APK.