https://github.com/jmp/react-native-bundle-extractor
A utility for extracting the React Native JavaScript bundle from an Android APK or a package installed on a connected device.
https://github.com/jmp/react-native-bundle-extractor
android apk bundle extract react-native
Last synced: about 1 year ago
JSON representation
A utility for extracting the React Native JavaScript bundle from an Android APK or a package installed on a connected device.
- Host: GitHub
- URL: https://github.com/jmp/react-native-bundle-extractor
- Owner: jmp
- License: mit
- Created: 2020-02-02T13:58:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-31T08:59:09.000Z (almost 2 years ago)
- Last Synced: 2025-04-25T15:59:02.296Z (about 1 year ago)
- Topics: android, apk, bundle, extract, react-native
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-bundle-extractor
[](https://codecov.io/gh/jmp/react-native-bundle-extractor)
This is a small utility for extracting the [React Native][1] JavaScript bundle
file from an Android APK. It can fetch the bundle either from an APK file
on the disk, or from an Android package installed on a connected device
(including Android virtual devices), without requiring deep knowledge of
the Android Debug Bridge (ADB).
Since React Native JavaScript bundles are typically minified, the tool
also runs it through [jsbeautifier][2] to get a more human-readable output.
The purpose of this tool is to give you a better idea of what your release
code will look like. It may convince you to obfuscate your JavaScript bundles.
## Installation
pip install -r requirements.txt
[Python](https://python.org/) 3.8 or later is recommended.
## Usage
To extract the bundle from an APK:
python extract.py foo.apk
To extract the bundle from connected device using `adb`:
python extract.py com.package.someapp
To customize the bundle filename, you can pass an additional parameter:
python extract.py com.package.someapp --bundle index.android.bundle
## Run tests
pytest
[1]: https://reactnative.dev/
[2]: https://pypi.org/project/jsbeautifier/