So there are tools out there to convert to and from a human readable representation. The most common human readable format is known as Smali. We can say that Smali acting like assembly language [🔗]. You can convert ("disassembler") dex to smali using baksmali [🔗] tool.
Example
int x = 42 //java
13 00 2A 00 //dex file contains this hex sequence
const/16 v0, 42 //smali
Extract APK
# Prints all packages
adb shell pm list packages
# Print the path to the .apk of the given installed package name
# Note: There can be more apk
adb shell pm path <com.package.app>
# Get apk(s)
adb pull <path>
Disassemble & Assemble
Apktool [🔗] is a tool for reverse engineering Android apps. It can decode (and disassemble) resources to nearly original form and rebuild them after making some modifications (and other stuff).
In this way you can read .smali code (so you don't need baksmali), AndroidManifest.xml, etc.
Note: even if you can extract apk like it was a zip, you can't read file such as AndroidManifest.xml because it's compiled. Here's why you should use a tool like apktool.
Disassemble
apktool d target.apk # Default output is in dist directory
Assemble (Single apk)
# Assemble (inside the folder of the disassembled apk)
apktool b .
# Sign
java -jar uber-apk-signer.jar -apk target.apk
Assemble (Splitted apk)
# Assemble (inside the folder of the disassembled apk)
java -jar APKEditor.jar m -i <path_splitted_apk> -o merged.apk
# Sign
java -jar uber-apk-signer.jar -a merged.apk --allowResign -o <merged_signed>
Troubleshooting apktool
INSTALL_FAILED_INVALID_APK: Failed to extract native libraries
This error occurs in some apktool versions with apps containing native libraries. To fix it, set extractNativeLibs to true in AndroidManifest.xml, then repackage and re-sign the APK.
If you have errors when you assemble try this:
apktool d -f -r target.apk
# Note: This do not decode resources
Dex to Java
Decompile to (near) source code (Dex to Java) using jadx [🔗].