/fb-graphql-schema

Decoding Facebook's GraphQL API schema

Primary LanguagePython

Description

This repository contains my work on reverse engineering Facebook's GraphQL API. Several versions of com.facebook.katana are known to distribute the API's schema. In a binary encoded form.

Using the files provided in this repository one can generate the type information. Present in the binary representation.

A decoded version is also provided in fb_graphql_types.json. A python module to aid in decoding FlatBuffers binaries is provided in fbs.py.

Instructions

To generate the graphql_types.json file, download Facebook for Android(v230.0.0.36.117).
Then run apktool d -r com.facebook.katana.apk.
Run flatc --json --strict-json --raw-binary graph_metadata.fbs -- graph_metadata.bin.
graph_metadata.bin is found in the assets directory.
And ./schema.py graph_metadata.json >fb_graphql_types.json.

Credits

This work has been inspired by fbchat.