How to list all Android dependencies from an Expo project?

Viewed 58

As most people familiar with Expo are aware, development has been a breeze thanks to its many layers of abstraction.

However, I've hit a wall and need to break out of my Expo bubble. I don't mean ejecting or re-writing the entire app. What I mean is to start gaining awereness of what's going on under the hood. This question specifically refers to dependency management & bundling.

I'm no expert on Android development, but I do have some basics. As far as I understand, dependencies are managed in a Java-like fashion. With concepts like the Java package, and tools like Gradle.

Expo manages dependencies using a NodeJS fashion. With concepts like the package.json and tools like npm/yarn.

When the time comes to build the android binary, Expo does something with the Javascript code & bundles it along several Andriod dependencies required for the project to run.

Therefore, what I need to get is a full list of all the Android native dependencies the resulting binary will include. i.e: com.company.example:identifier:x.y.z

I've used JADX to de-compile a resulting .aab from Expo and while the result is quite insightful, it's missing a reliable manifest listing all the bundled packages. Said manifest might not even exist, as all the bundled packages will probably be included along the rest of the source code, so there's no need to list them separetly. A manifest like that would make most sense before building. It does have an Android Manifest, but that one doesn't list dependencies.

What I did though, is to cd into the de-compiled project and run the command:

grep -rh . -e '^package.\+;' | sort -u > packages.log

The output looks promising, but I'm no expert and I need to be 100% sure before telling my boss. Decompiling isn't always 100% reliable due to some code being impossible to decode.

I've also tried expo prebuild but the resulting gradle files will not list all dependencies directly. Instead they require dependencies defined in a package.json using a weird directive like so:

url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))

Not sure how to manually execute that directive, or how that gets eventually translated to native android dependencies (i.e com.facebook.react.uimanager).

Please, I need help listing all the Android dependencies for an Expo project and being 100% sure about it.

0 Answers
Related