How To: Reverse Engineer Any Private API (iOS/Android and Desktop)

Have you ever wanted to access data from an application that doesn't provide a Public API? Well I've got great news. That application is getting its data from somewhere. You just need to find out how to plug into it! This process is called Reverse Engineering (Or hacking if you want to pretend you're really smart) a Private API. I will document some tips and useful tools that will help you reverse any Private API from any application on any platform.

Reverse Engineer any Private API - Watch the YouTube video here! https://youtu.be/RchCi6E2hVs

Tools

There are a handful of tools that can be used to complete this task. Windows 10 was my platform of choice for working with the data so I'll be sharing what I used on here.

Fiddler: Fiddler is an HTTP/HTTPS Proxy that can be used to intercept and decrypt SSL/HTTPS traffic. This application is also useful for replaying requests, creating custom request, and exporting a request as cURL to be converted into Python 3. Fiddler is free to use, just sign in with your Google Account! Make sure you install the certificate and enable HTTPS mode so you don't miss any requests. https://www.telerik.com/fiddler

MitM Proxy: Man in the Middle Proxy is a great way to read data from Smart Phone Applications. This is what I used to get all the data I needed for my API reversal. Simply download the executable from https://mitmproxy.org/ to start up a server (disable your firewall or open port 8080) and then enter your PC's IP address into the Proxy Server settings of your Phones WiFi settings. After that navigate to http://mitm.it/ on your Phone and install the provided certificate. Follow the provided instructions on http://mitm.it/ and start sniffing!

Tips

Create a text document to save all your finding and especially any useful URL endpoints you find. Having your information organized will help to ensure that you don't waste time on the same thing twice or need to proxy your device over and over again to find what a request should look like.

For more information and an example of the API reversed you can watch my YouTube tutorial here.

How To Hide Android 10 Q Navigation Bar

With Android 10 Q full gesture navigation is finally available. Google has unfortunately overlooked the option for users to simply hide the bottom navigation bar once they have become accustomed to the gestures. Thankfully there is already an app that will allow you to toggle the navbar’s visibility (well actually it just draws it below the screen). This can be done easily on rooted devices but it is also available to non-rooted phones as well. If your device DOES NOT have root access this requires a PC (Windows, Linux/BSD, or Mac) to enable the functionality.

This does NOT require your device to be rooted. The following ADB command does NOT void your devices warranty, you are just granting an additional permission to an app that is unavailable through the GUI.

If your device IS ALREADY rooted you can simply grant the app SuperUser and skip the command.

There are currently two apps that offer a toggle setting for the navigation bar once the required command has been run.

  1. Navigation Gestures - Swipe Gesture Controls! by XDA (recommended)
  2. Hide Navigation Bar by Manuel Wrage

If you are rooted: grant your selected app SuperUser, finish the on-boarding and enable the setting. Your navigation bar should now be off screen.

For those who aren’t rooted, lets now grant your selected app the secure settings permission. Depending on which app you decide to use the command will be slightly different as you are actually granting the specific app an additional system permission. 

Enable Developer Mode & USB Debugging

First you need to let your phone communicate with your PC via USB debugging.

Open your Android settings app, scroll to bottom and select “About Phone”, scroll to the bottom again and tap the build number seven(7) times, enable developer mode

Settings>About Phone>Tap Build Number 7 Times>Enable Developer Mode

Now that you’re a developer go back to the main settings page, select System, Advanced, Developer options, enable USB debugging 

Settings>System>Advanced>Developer options>USB debugging

Installing ADB

ADB or the Android Debug Bridge is available for all platforms. You can follow this in depth guide on XDA https://www.xda-developers.com/install-adb-windows-macos-linux/

If you’re on Linux you should be able to install ‘android-tools-adb’ on any Debian or Ubuntu based system. https://packages.debian.org/buster/android-tools-adb

On Arch/Manjaro systems ADB is provided through the ‘android-tools’ package. https://www.archlinux.org/packages/community/x86_64/android-tools/

Once you have some kind of ADB binary on your system you can now plug in and trust your device, then run the following command depending on which of the toggle apps you’ve chosen.

Navigation Gestures - Swipe Gesture Controls! by XDA

adb shell pm grant com.xda.nobar android.permission.WRITE_SECURE_SETTINGS

Hide Navigation Bar by Manuel Wrage

adb shell pm grant com.ivianuu.hidenavbar android.permission.WRITE_SECURE_SETTINGS

If you get an error about the device not being trusted, unlock your device and trust your PC for USB debugging.

After you have successfully granted the app the permission you’re done! Now enter the app and toggle the setting on or off whenever you want!