anestisb / vdexExtractor

Tool to decompile & extract Android Dex bytecode from Vdex files
Apache License 2.0
1k stars 215 forks source link

vdexExtractor does not extract services.dex in the framework of Android10 #64

Closed JinghanGuo closed 4 years ago

JinghanGuo commented 4 years ago

Hi @anestisb , I am trying to extract Dexs file from services.vdex. I see in another post you said this can be done through extracting APK file, but services.vdex comes from Android10(API level 29) framework so no APK available. Please see the below. services.vdex is attached. Thanks!

$ vdexExtractor -i services.vdex -v 4
[INFO] Processing 1 file(s) from services.vdex
[DEBUG] [30330] 2020/04/30 13:44:18 (vdexExtractor.c:224 main) Processing 'services.vdex'
[DEBUG] [30330] 2020/04/30 13:44:18 (vdex_api.c:53 vdexApi_initEnv) Initializing environment for Vdex version '021'
------ Vdex Header Info -------
magic header                  : vdex
verifier dependencies version : 021
dex section version           : 000
number of dex files           : 2 (2)
verifier dependencies size    : 1f414 (128020)
verifier dependencies offset  : 24 (36)
quickening info size          : 0 (0)
quickening info offset        : ffffffff (4294967295)
boot clspath checksums size   : 0 (0)
boot clspath checksums offset : ffffffff (4294967295)
class loader context size     : 0 (0)
class loader context offset   : ffffffff (4294967295)
---- EOF Vdex Header Info ----
[DEBUG] [30330] 2020/04/30 13:44:18 (vdex/vdex_backend_021.c:407 vdex_backend_021_process) Vdex has no Dex data - skipping
[DEBUG] [30330] 2020/04/30 13:44:18 (vdex/vdex_021.c:363 vdex_021_process) Took 0 ms to process Vdex file
[INFO] 1 out of 1 Vdex files have been processed
[INFO] 0 Dex files have been extracted in total
[INFO] Extracted Dex files are available in '.'

services.vdex.zip

jiajunpei commented 4 years ago

As far as I know, vdexExtractor can only work when vdex file contains dex file. And for Android Q version, dex2oat will not copy dex file to vdex file if dex file is stored with an uncompressed format in the jar file. So I suggest that you shall first check the origin service.jar file to check whether it contains the dex files or not.

JinghanGuo commented 4 years ago

@jiajunpei Thanks!

gspeiliu commented 3 years ago

@JinghanGuo Did you solve the problem you posted?

newtonsart commented 2 years ago

aight, so im getting the same errors in android 11, everything seems to work fine, and the services.jar file has exactly 3 too. image