• Stars
    star
    244
  • Rank 165,885 (Top 4 %)
  • Language
    TypeScript
  • License
    GNU Affero Genera...
  • Created almost 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Decompile React Native Android/IOS Bundle.

Would you like to support me?

React Native Decompiler [ALPHA]

A CLI for React Native that allows you to decompile JS code of Android and IOS.

icon

DOES NOT SUPPORT ENCRYPTED/BINARY (FACEBOOK, INSTAGRAM) BUNDLES

Decompiles React Native index.android.bundle JS files. Webpack files too!

Also tries to remove some compilation artifacts (via internal plugins, ESLint, and Prettier) to make it easier to read.

using npx

npx react-native-decompiler

using npm

npm i -g react-native-decompiler
react-native-decompiler

# or you can write blow command

rnd

Usage

Example 1: npx react-native-decompiler -i ./index.android.bundle -o ./output

Example 2: npx react-native-decompiler -i ./main.jsbundle -o ./output

Example 3: react-native-decompiler -i ./index.android.bundle -o ./output

Example 4: rnd -i ./index.android.bundle -o ./output

Command params:

  • -i (required) - input file/folder
  • -o (required) - the path to the output folder
  • -e - a module ID, if specified will only decompile that module & it's dependencies.
  • -p - performance monitoring flag, will print out runtime for each decompiler plugin
  • -v - verbose flag, does not include debug logging (use DEBUG=react-native-decompiler:* env flag for that)
  • --es6 - attempts to decompile to ES6 module syntax.
  • --noEslint - does not run ESLint after doing decompilation
  • --prettier - does not run Prettier after doing decompilation
  • --unpackOnly - only unpacks the app with no other adjustments
  • --decompileIgnored - decompile ignored modules (modules are generally ignored if they are flagged as an NPM module)
  • --agressiveCache - skips some cache checks at the expense of possible cache desync
  • --noProgress - don't show progress bar
  • --debug - when also given a module ID, will print out that modules code after any plugin handles the app.

Android

Extract index.android.bundle from APK

installation of apktool

For Macbook

brew install apktool

For Linux

apt-get install -y apktool

For Window

you can read installion step for window DOCS

after install apktool, unzip apk file by run this command on terminal like this:

apktool  d /pathOfApkFile.apk

After that you will get index.android.bundle file at pathOfApkFile/assets/index.android.bundle

than you can use react-native-decompiler for decompile index.android.bundle file

IOS

Extract main.jsbundle from IPA

you can unzip ipa by unzip command on terminal

$ unzip AppName.ipa

after unzip, you will get Playload folder, then you have to copy main.jsbundle file. there are two ways to copy this file as follow below

  1. run this command cp ./Payload/AppName.app/main.jsbundle ./ to get get main.jsbundle file

  2. Go to Payload folder and right click on AppName.app and choose Show Package Contents then you will find main.jsbundle file at root. you can copy this file to any location

after getting main.jsbundle you can use react-native-decompiler for decompile main.jsbundle file

Valid inputs

The following input formats are currently supported:

  • A single index.android.bundle/main.jsbundle file that contains all modules (most cases for React Native)
  • A folder containing React Native modules (usually called js-modules) in "unbundled" apps
  • A single Webpack entrypoint bundle file (entrypoint bundles begin with !function(e), chunked bundles start with window.webpackJsonp)
  • A folder containg Webpack chunks, where at least one file is the entrypoint

Extending

The decompiler operates on a tagger -> editor -> decompiler system.

  • Taggers - Manipulates the module metadata
  • Editors - Manipulates the module lines (add, move, or remove).
  • Decompilers - Manipulates the module code.

To add a new plugin, add it into the represpective list.

The plugins are initialized per module, so any data you store in your plugins will only persist for the current module.

If your plugin needs to be run before or after other plugins, adjust the ordering in the list, or modify it's pass position.

Guidelines:

  • When doing any modifications to the AST, use the NodePath methods.
  • When you are only doing reading, directly reading from .node is acceptable.

Contributors โœจ

All Contributors

Thanks goes to these wonderful people (emoji key):


Richard

๐Ÿ’ป

Numan

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

react-native-compressor

๐Ÿ—œ๏ธCompress Image, Video, and Audio same like Whatsapp ๐Ÿš€โœจ
Kotlin
779
star
2

react-native-bottomsheet-reanimated

React Native bottom sheet with fully native 60 FPS animations and awesome user experience
TypeScript
274
star
3

react-native-keys

๐Ÿ” Protected .ENVs variables in React Native ๐Ÿš€โœจ
C++
271
star
4

open-source-react-native-apps

๐Ÿ“ฑ Collaborative List of Open-Source React Native Apps
39
star
5

react-native-component-splitter

VS Code Extension allows splitting React Native Component into Sub-Component
TypeScript
36
star
6

react-native-interactable-reanimated

This is a copy of interactable from react-native-reanimated
JavaScript
34
star
7

react-native-curved-bottom-tabbar

Curved Bottom Tabbar React Native
JavaScript
26
star
8

mtsl

Tangible symlinks using cokidar (CLI)
JavaScript
22
star
9

github-emoji-extension

Github Emoji Chrome Extension ๐Ÿ‘๐Ÿ‘Ž๐Ÿ˜๐ŸŽ‰๐Ÿ˜•โค๐Ÿš€๐Ÿ‘€
TypeScript
22
star
10

linkedin-auto-bot

LinkedIn bot for auto connect
JavaScript
18
star
11

intellij-merge-tool

VS Code extension for open merge tool of intellij
TypeScript
16
star
12

react-native-best-practice

React Native best practices๐Ÿ“šโœจ
JavaScript
12
star
13

expo-library

CLI for creating reusable, modern Expo libraries using monorepo and expo init.
JavaScript
11
star
14

react-native-image-compressor

React Native Compress Image for Android And Ios
Objective-C
10
star
15

react-native-turbomodule-fabric-renderer-boilerpate

Turbomodule and Fabric renderer boilerplate
Java
9
star
16

release-notes-cli

Generate release notes from git commit history either commit range or tag range.
TypeScript
7
star
17

react-native-tiktok-progressbar

TIKTOK video progress bar
JavaScript
7
star
18

react-native-gifsicle

Compress, Optimize and Manipulate GIF in React Native ๐Ÿš€โœจ
C
7
star
19

react-native-emoji-hook

Write emoji by emoji code :D = ๐Ÿ˜„
JavaScript
6
star
20

react-native-masonry-grid

Customizable masonry Flatlist. it just behave like Flatlist but using ScrollView behind the scene
TypeScript
6
star
21

react-native-process-text-intent

Get text from android android.intent.action.PROCESS_TEXT intent-filter
Java
5
star
22

rotate-video

Rotate Single video / Entire directory of videos with FFMPEG
JavaScript
4
star
23

decompiled-whatsapp

Java
3
star
24

ckeditor-boilerplate

JavaScript
2
star
25

clone-boilerplate

clone universal boilerplates for every language (CLI).
TypeScript
2
star
26

React-Native-Sift

Java
2
star
27

react-native-keyboardawareview-spacer

it is useful when you use Portal
JavaScript
2
star
28

react-native-jsi-boilerplate

React Native JSI boilerplate
C++
2
star
29

git-recover

Recover (git add) files that we lost accidentally
TypeScript
1
star
30

fabric-reanimated-repro

TypeScript
1
star
31

git-toolkit

This is a CLI and easy toolkit for git
JavaScript
1
star
32

ReactNativePhotoEditor

license test
Java
1
star
33

multiSearchReact

CSS
1
star
34

boilerplate-examples

add universal boilerplates for clone-boilerplate CLI.
PHP
1
star
35

react-native-usemarkdown-chat

hook for chats markdown in Textinput
TypeScript
1
star
36

nodejs-file-uploader

Nodejs file uploader server (PUT, POST) for https://github.com/numandev1/react-native-compressor backgroundUpload
JavaScript
1
star