# FireBased
A based implementation of the Firebase API. This project is a partial wrapper around the Firebase API.
With just the teeniest bit of extra work, you can hook this up like
someone did in [Push-Server](https://github.com/lastrise/Push-Server) to a
REST API and have a full-fledged push notification server.
## Privacy Notice
Note that App developers CANNOT see the device you used to register with.
Therefore, the device you register the FCM token with does not need to match the device you actually use the token with.
However, once you associated an FCM token with a given device, at this point, the app developer CAN save that association.
## Note From The Creator
If you are using this, you are a developer. You know what you are doing.
I am not responsible for any misuse of this software.
I am not responsible for any bans or other actions taken against your account.
If you are hiring, e-mail `isaacikogan@gmail.com`. Let's chat :)!
## Helpful Tips
There are only a few identifiers you need to make requests.
All of them can be found in the APK of the app you want to register firebase for:
- `google_api_key` e.g. "AIzaSyA1b2C3dE4f5G6H7I8J9K0LmNOpQrStUvWx"
- `google_app_id` e.g. "1:123456789012:android:abcdefghijklm1234567"
- `google_app_package` e.g. "com.example.app"
- `google_app_name` e.g. "api-project-123456789012"
- `google_android_cert` e.g. "12345678A1B2C3D4E5F6G7H8I9J0KLMNOPQRSTU"
For your convenience, here is a basic example script that can generate a GCM token:
```python
import asyncio
from FireBased.client.client import FireBasedClient
from FireBased.client.proto import CheckInRequestMessage, CheckInResponseMessage
from FireBased.client.schemas import RegisterInstallRequestBody, RegisterInstallRequestBodyJsonBody, RegisterGcmRequestBody, FirebaseInstallationRequestResponse, RegisterGcmRequestResponse
from FireBased.ext.synthetic_data import create_synthetic_check_in, create_mobile_user_agent
google_api_key = "AIzaSyA1b2C3dE4f5G6H7I8J9K0LmNOpQrStUvWx" # Firebase API key
google_app_id = "1:123456789012:android:abcdefghijklm1234567" # Firebase app ID
google_app_package = "com.example.app" # Package name of the Android app
google_app_name = "api-project-123456789012" # Firebase app name
google_android_cert = "12345678A1B2C3D4E5F6G7H8I9J0KLMNOPQRSTU" # Sha-1 APK signing cert
async def generate_gcm_token() -> str:
# Starts an HTTP client under the hood. Best to use in an async context manager for safety.
async with FireBasedClient() as fb:
# Create a synthetic check-in payload.
# Note that according to ChatGPT, developers can't access the data you send here.
# All they can really check is the Firebase ID, GCM token, and the Android ID.
check_in_payload: CheckInRequestMessage = create_synthetic_check_in()
check_in_response: CheckInResponseMessage = await fb.check_in(body=check_in_payload)
# Create the installation registration payload
register_install_payload: RegisterInstallRequestBody = RegisterInstallRequestBody(
app_public_key=google_api_key,
app_package=google_app_package,
app_name=google_app_name,
json_body=RegisterInstallRequestBodyJsonBody(appId=google_app_id),
user_agent=create_mobile_user_agent(),
app_cert=google_android_cert
)
# Register the installation
install_data: FirebaseInstallationRequestResponse = await fb.register_install(
body=register_install_payload
)
# Finally, register the GCM token using the data from the previous requests
gcm_response: RegisterGcmRequestResponse = await fb.register_gcm(
body=RegisterGcmRequestBody.from_models(
install_request_body=register_install_payload,
install_request_response=install_data,
check_in_request_response=check_in_response
)
)
return gcm_response.token
if __name__ == '__main__':
gcm_token: str = asyncio.run(generate_gcm_token())
print(f"Generated GCM token: {gcm_token}")
```
Latest pertinent data is found at `https://github.com/firebase/firebase-js-sdk`
## Contributors
* **Isaac Kogan** - *Creator, Primary Maintainer, and Reverse-Engineering* - [isaackogan](https://github.com/isaackogan)
* **Lastrise** - *Reverse-Engineering* - [lastrise](https://github.com/lastrise)
See also the full list of [contributors](https://github.com/isaackogan/Grindr/contributors) who have participated in
this project.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/isaackogan/FireBased",
"name": "FireBased",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Firebase, Reverse Engineering, python3, api, unofficial",
"author": "Tricorder",
"author_email": "tricorder@isaackogan.com",
"download_url": "https://files.pythonhosted.org/packages/34/2f/18a3146f483c75f6746067dc7063df6ffe0447cd5cf1021b58e2b8b726fa/firebased-0.0.2.post5.tar.gz",
"platform": null,
"description": "# FireBased\n\nA based implementation of the Firebase API. This project is a partial wrapper around the Firebase API.\n\nWith just the teeniest bit of extra work, you can hook this up like\nsomeone did in [Push-Server](https://github.com/lastrise/Push-Server) to a\nREST API and have a full-fledged push notification server.\n\n## Privacy Notice\n\nNote that App developers CANNOT see the device you used to register with. \nTherefore, the device you register the FCM token with does not need to match the device you actually use the token with.\nHowever, once you associated an FCM token with a given device, at this point, the app developer CAN save that association.\n\n## Note From The Creator\n\nIf you are using this, you are a developer. You know what you are doing.\nI am not responsible for any misuse of this software.\nI am not responsible for any bans or other actions taken against your account.\n\nIf you are hiring, e-mail `isaacikogan@gmail.com`. Let's chat :)!\n\n## Helpful Tips\n\nThere are only a few identifiers you need to make requests.\nAll of them can be found in the APK of the app you want to register firebase for:\n\n- `google_api_key` e.g. \"AIzaSyA1b2C3dE4f5G6H7I8J9K0LmNOpQrStUvWx\"\n- `google_app_id` e.g. \"1:123456789012:android:abcdefghijklm1234567\"\n- `google_app_package` e.g. \"com.example.app\"\n- `google_app_name` e.g. \"api-project-123456789012\"\n- `google_android_cert` e.g. \"12345678A1B2C3D4E5F6G7H8I9J0KLMNOPQRSTU\"\n\nFor your convenience, here is a basic example script that can generate a GCM token:\n\n```python\nimport asyncio\n\nfrom FireBased.client.client import FireBasedClient\nfrom FireBased.client.proto import CheckInRequestMessage, CheckInResponseMessage\nfrom FireBased.client.schemas import RegisterInstallRequestBody, RegisterInstallRequestBodyJsonBody, RegisterGcmRequestBody, FirebaseInstallationRequestResponse, RegisterGcmRequestResponse\nfrom FireBased.ext.synthetic_data import create_synthetic_check_in, create_mobile_user_agent\n\ngoogle_api_key = \"AIzaSyA1b2C3dE4f5G6H7I8J9K0LmNOpQrStUvWx\" # Firebase API key\ngoogle_app_id = \"1:123456789012:android:abcdefghijklm1234567\" # Firebase app ID\ngoogle_app_package = \"com.example.app\" # Package name of the Android app\ngoogle_app_name = \"api-project-123456789012\" # Firebase app name\ngoogle_android_cert = \"12345678A1B2C3D4E5F6G7H8I9J0KLMNOPQRSTU\" # Sha-1 APK signing cert\n\n\nasync def generate_gcm_token() -> str:\n # Starts an HTTP client under the hood. Best to use in an async context manager for safety.\n async with FireBasedClient() as fb:\n # Create a synthetic check-in payload.\n # Note that according to ChatGPT, developers can't access the data you send here.\n # All they can really check is the Firebase ID, GCM token, and the Android ID.\n check_in_payload: CheckInRequestMessage = create_synthetic_check_in()\n check_in_response: CheckInResponseMessage = await fb.check_in(body=check_in_payload)\n\n # Create the installation registration payload\n register_install_payload: RegisterInstallRequestBody = RegisterInstallRequestBody(\n app_public_key=google_api_key,\n app_package=google_app_package,\n app_name=google_app_name,\n json_body=RegisterInstallRequestBodyJsonBody(appId=google_app_id),\n user_agent=create_mobile_user_agent(),\n app_cert=google_android_cert\n )\n\n # Register the installation\n install_data: FirebaseInstallationRequestResponse = await fb.register_install(\n body=register_install_payload\n )\n\n # Finally, register the GCM token using the data from the previous requests\n gcm_response: RegisterGcmRequestResponse = await fb.register_gcm(\n body=RegisterGcmRequestBody.from_models(\n install_request_body=register_install_payload,\n install_request_response=install_data,\n check_in_request_response=check_in_response\n )\n )\n\n return gcm_response.token\n\n\nif __name__ == '__main__':\n gcm_token: str = asyncio.run(generate_gcm_token())\n print(f\"Generated GCM token: {gcm_token}\")\n```\n\nLatest pertinent data is found at `https://github.com/firebase/firebase-js-sdk`\n\n## Contributors\n\n* **Isaac Kogan** - *Creator, Primary Maintainer, and Reverse-Engineering* - [isaackogan](https://github.com/isaackogan)\n* **Lastrise** - *Reverse-Engineering* - [lastrise](https://github.com/lastrise)\n\nSee also the full list of [contributors](https://github.com/isaackogan/Grindr/contributors) who have participated in\nthis project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Firebase token generation",
"version": "0.0.2.post5",
"project_urls": {
"Homepage": "https://github.com/isaackogan/FireBased"
},
"split_keywords": [
"firebase",
" reverse engineering",
" python3",
" api",
" unofficial"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "09bb0e68c877282908677211dc5f73e77eec08d30f72c03b8858e17384d268c4",
"md5": "5093e113616d31554a1aa29c238bec27",
"sha256": "0826e2ed0454c6525a07505b5e5918ec447bd21309fb1f435c6361c5849347b7"
},
"downloads": -1,
"filename": "FireBased-0.0.2.post5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5093e113616d31554a1aa29c238bec27",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11185,
"upload_time": "2025-02-12T23:14:53",
"upload_time_iso_8601": "2025-02-12T23:14:53.390405Z",
"url": "https://files.pythonhosted.org/packages/09/bb/0e68c877282908677211dc5f73e77eec08d30f72c03b8858e17384d268c4/FireBased-0.0.2.post5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "342f18a3146f483c75f6746067dc7063df6ffe0447cd5cf1021b58e2b8b726fa",
"md5": "e52d85fefb0c634e5ffe1f29ad6c7bd0",
"sha256": "de8f57b85bb1a8259ba259c56cfb6f3ae0bc373875fceea9148628e44f30a215"
},
"downloads": -1,
"filename": "firebased-0.0.2.post5.tar.gz",
"has_sig": false,
"md5_digest": "e52d85fefb0c634e5ffe1f29ad6c7bd0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9766,
"upload_time": "2025-02-12T23:14:56",
"upload_time_iso_8601": "2025-02-12T23:14:56.690124Z",
"url": "https://files.pythonhosted.org/packages/34/2f/18a3146f483c75f6746067dc7063df6ffe0447cd5cf1021b58e2b8b726fa/firebased-0.0.2.post5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-12 23:14:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "isaackogan",
"github_project": "FireBased",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "firebased"
}