Closed lapwat closed 4 years ago
In general, smali expects the files to be in the same relative locations as on the device. The easiest way to ensure this is to just adb pull the entire app folder.
Thank you for this information, I pulled the NfcNci app folder directly and retried with following configuration.
$ tree --filelimit=10
.
├── NfcNci.apk
├── arm64 [84 entries exceeds filelimit, not opening dir]
├── baksmali-2.4.0.jar
├── lib
│ └── arm64
│ └── libnfc_nci_jni.so
└── oat
└── arm64
├── NfcNci.odex
└── NfcNci.vdex
Running the command gives me the same exceptions:
$ java -jar baksmali-2.4.0.jar x -c arm64/boot.oat -d arm64/ oat/arm64/NfcNci.odex -o NfcNci/
Exception in thread "main" java.lang.RuntimeException: "oat/arm64/NfcNci.odex" has no dex files
at org.jf.baksmali.DexInputCommand.loadDexFile(DexInputCommand.java:167)
at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:162)
at org.jf.baksmali.Main.main(Main.java:102)
I am trying to reproduce this behavior of apktool
which works great without having to specify any odex/vdex files:
$ apktool if framework-res.apk
$ apktool disassemble NfcNci.apk
...
I: Baksmaling classes.dex...
...
# now I have a NfcNci folder with disassembled smali files
Found out that I confused deodex (x option)
and disassemble (d option)
.
Still confused about apks that include dex file and others that do not.
Thank you for your time.
I am trying to disassemble
NfcNci.apk
.I have
adb pull
in an empty folder the following files/folders from my phone:I run the command:
I
adb pull /system/app/NfcNci/oat/arm64/NfcNci.vdex
in the same folder and retry the same command:How can I get the smali files from
NfcNci.apk
? Which files need to be specified in the command ? Which files are not specified in the command but need to be present in the same folder and accurately named ?Thank you for your time.