{"id":32525623,"url":"https://github.com/anestisb/vdexextractor","last_synced_at":"2025-10-28T09:51:47.410Z","repository":{"id":39380760,"uuid":"106165247","full_name":"anestisb/vdexExtractor","owner":"anestisb","description":"Tool to decompile \u0026 extract Android Dex bytecode from Vdex files","archived":false,"fork":false,"pushed_at":"2022-06-24T07:59:46.000Z","size":571,"stargazers_count":937,"open_issues_count":16,"forks_count":220,"subscribers_count":41,"default_branch":"master","last_synced_at":"2023-11-07T14:15:17.145Z","etag":null,"topics":["android","art-runtime","bytecode","bytecode-unquickening","cdex","compactdex","decompiler","dex","disassembler","libart","vdex"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anestisb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-08T09:44:48.000Z","updated_at":"2023-11-07T00:39:21.000Z","dependencies_parsed_at":"2022-08-09T14:48:38.817Z","dependency_job_id":null,"html_url":"https://github.com/anestisb/vdexExtractor","commit_stats":null,"previous_names":[],"tags_count":14,"template":null,"template_full_name":null,"purl":"pkg:github/anestisb/vdexExtractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2FvdexExtractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2FvdexExtractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2FvdexExtractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2FvdexExtractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anestisb","download_url":"https://codeload.github.com/anestisb/vdexExtractor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2FvdexExtractor/sbom","scorecard":{"id":195669,"data":{"date":"2025-08-11","repo":{"name":"github.com/anestisb/vdexExtractor","commit":"78f283b60ab6991fa27eeaff7d7be16409401c08"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 4/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T21:46:54.540Z","repository_id":39380760,"created_at":"2025-08-16T21:46:54.540Z","updated_at":"2025-08-16T21:46:54.540Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281418064,"owners_count":26497723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","art-runtime","bytecode","bytecode-unquickening","cdex","compactdex","decompiler","dex","disassembler","libart","vdex"],"created_at":"2025-10-28T09:51:45.400Z","updated_at":"2025-10-28T09:51:47.401Z","avatar_url":"https://github.com/anestisb.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vdex Extractor\n\nCommand line tool to decompile and extract Android Dex bytecode from Vdex files that are generated\nalong with Oat files when optimizing bytecode from dex2oat ART runtime compiler. Vdex file format\nhas been introduced in the Oreo (API-26) build. More information is available [here][vdex-cr]. It\nshould be noted that Oat files are no longer storing the matching Dex files inside their `.rodata`\nsection. Instead they're always paired with a matching Vdex container file.\n\n\n## Compile\n\n* Clone this repository\n* Install Android NDK if you want to cross-compile for Android devices\n* Invoke `make.sh` bash script with desired build target\n  * `$ ./make.sh` - if CC not defined from env use gcc by default\n  * `$ ./make.sh gcc` - compile with gcc\n  * `$ ./make.sh clang` - compile with clang\n  * `$ ./make.sh cross-android` - cross-compile (armeabi-v7a, arm64-v8a, x86 \u0026\n  x86_64) for Android with NDK\n* Executables are copied under the `bin` directory\n* For debug builds use `$ DEBUG=true ./make.sh`\n\n\n## Dependencies\n\nThe following external libraries should be installed the in the host system:\n\n1. zlib\n    * macOS with homebrew: `brew install zlib-devel`\n    * macOS with macports: `port install zlib`\n    * Linux with apt: `apt install libz-dev`\n    * Other Linux/Unix systems: Check available package manager or compile from sources\n    * Windows with cygwin: Install `zlib-devel` from cygwin installer\n\n\n## Usage\n\n```\n$ bin/vdexExtractor -h\n              vdexExtractor ver. 0.5.2\n    Anestis Bechtsoudis \u003canestis@census-labs.com\u003e\n  Copyright 2017 - 2018 by CENSUS S.A. All Rights Reserved.\n\n -i, --input=\u003cpath\u003e   : input dir (search recursively) or single file\n -o, --output=\u003cpath\u003e  : output path (default is same as input)\n -f, --file-override  : allow output file override if already exists (default: false)\n --no-unquicken       : disable unquicken bytecode decompiler (don't de-odex)\n --deps               : dump verified dependencies information\n --dis                : enable bytecode disassembler\n --ignore-crc-error   : decompiled Dex CRC errors are ignored (see issue #3)\n --new-crc=\u003cpath\u003e     : text file with extracted Apk or Dex file location checksum(s)\n --get-api             : get Android API level based on Vdex version (expects single Vdex file)\n -v, --debug=LEVEL    : log level (0 - FATAL ... 4 - DEBUG), default: '3' (INFO)\n -l, --log-file=\u003cpath\u003e: save disassembler and/or verified dependencies output to log file (default is STDOUT)\n -h, --help           : this help\n```\n\n\n## Bytecode Unquickening Decompiler\n\nThe Vdex file includes all quick_info data (old vtable) required to revert the dex-to-dex\ntransformations applied during bytecode optimization. The idea here is to create a quick standalone\ntool capable to revert optimized bytecode, that does not require building the entire libart from\nAOSP.\n\nThe Vdex fully unquicken functionality has been also implemented as part of the AOSP oatdump libart\ntool. The upstream contribution is available [here][aosp-master]. If you want to use oatdump with\nOreo release you can use the corresponding patch [here][oatdump-oreo] or fork and build (inside and\nAOSP_SRC_ROOT workspace) the oreo-release branch of the [oatdump++][oatdump-plus] tool. Google has\nreleased the contributed patches along with the Android Pie release of the ART runtime. However,\nthe upstream oatdump is appending the entire de-duplicated shared data section at the end of each\nCompactDex file when exporting.\n\n\n## Verified Dependencies Iterator\n\nWhen the Dex bytecode files are compiled (optimized) for the first time, dex2oat executes the\nverification dependencies collector as part of the MethodVerifier The verification dependencies\ncollector class is used to record resolution outcomes and type assignability tests of\nclasses/methods/fields defined in the classpath. The compilation driver initializes the class and\nregisters all Dex files which are being compiled. Classes defined in Dex files outside of this set\n(or synthesized classes without associated Dex files) are considered being in the classpath. All\nrecorded dependencies are stored in the generated Vdex file along with the corresponding Oat file\nfrom the OatWriter class.\n\nvdexExtractor tool integrates a Vdex dependencies walker function that is capable to iterate all\ndependencies information and dump them in a human readable format. The following snippet\ndemonstrates a dependencies dump example of a sample Vdex file.\n\n```\n$ bin/vdexExtractor -i /tmp/BasicDreams.vdex -o /tmp --deps -f\n[INFO] Processing 1 file(s) from /tmp/BasicDreams.vdex\n------- Vdex Deps Info -------\ndex file #0\n extra strings: number_of_strings=2\n  0000: 'Ljava/lang/Thread;'\n  0001: 'Ljava/lang/Throwable;'\n assignable type sets: number_of_sets=8\n  0000: 'Landroid/service/dreams/DreamService;' must be assignable to 'Landroid/content/Context;'\n  0001: 'Landroid/view/TextureView;' must be assignable to 'Landroid/view/View;'\n  0002: 'Ljava/nio/FloatBuffer;' must be assignable to 'Ljava/nio/Buffer;'\n...\n unassignable type sets: number_of_sets=0\n class dependencies: number_of_classes=34\n  0000: 'Landroid/graphics/Color;' 'must' be resolved with access flags '1'\n  0001: 'Landroid/graphics/SurfaceTexture;' 'must' be resolved with access flags '1'\n...\n  0024: 'Ljavax/microedition/khronos/egl/EGL10;' 'must' be resolved with access flags '513'\n...\n field dependencies: number_of_fields=4\n  0000: 'Ljavax/microedition/khronos/egl/EGL10;'-\u003e'EGL_DEFAULT_DISPLAY':'Ljava/lang/Object;' is expected to be in class 'Ljavax/microedition/khronos/egl/EGL10;' and have the access flags '9'\n  0001: 'Ljavax/microedition/khronos/egl/EGL10;'-\u003e'EGL_NO_CONTEXT':'Ljavax/microedition/khronos/egl/EGLContext;' is expected to be in class 'Ljavax/microedition/khronos/egl/EGL10;' and have the access flags '9'\n  0002: 'Ljavax/microedition/khronos/egl/EGL10;'-\u003e'EGL_NO_DISPLAY':'Ljavax/microedition/khronos/egl/EGLDisplay;' is expected to be in class 'Ljavax/microedition/khronos/egl/EGL10;' and have the access flags '9'\n  0003: 'Ljavax/microedition/khronos/egl/EGL10;'-\u003e'EGL_NO_SURFACE':'Ljavax/microedition/khronos/egl/EGLSurface;' is expected to be in class 'Ljavax/microedition/khronos/egl/EGL10;' and have the access flags '9'\n method dependencies: number_of_methods=84\n  0000: 'Landroid/graphics/Color;'-\u003e'HSVToColor':'([F)I' is expected to be in class 'Landroid/graphics/Color;', have the access flags '9\n  0001: 'Landroid/opengl/GLES20;'-\u003e'glAttachShader':'(II)V' is expected to be in class 'Landroid/opengl/GLES20;', have the access flags '9\n  0002: 'Landroid/opengl/GLES20;'-\u003e'glClear':'(I)V' is expected to be in class 'Landroid/opengl/GLES20;', have the access flags '9\n...\n unverified classes: number_of_classes=0\n----- EOF Vdex Deps Info -----\n[INFO] 1 out of 1 Vdex files have been processed\n[INFO] 1 Dex files have been extracted in total\n[INFO] Extracted Dex files are available in '/tmp'\n```\n\n\n## Integrated Disassembler\n\nTo debug the decompiler and assist the Dex bytecode investigation tasks, a light disassembler has\nbeen implemented. The disassembler output is very similar to the one provided by the AOSP dexdump2\nutility of the `platform/art` project. The disassembler can be used independently of the\nunquickening decompiler.\n\nA sample output is illustrated in the following snippet. Lines prefixed with `[new]` illustrate the\noutput of the decompiled instruction (previous line) located in that offset. Notice that all the\nquickened offsets and vtable references have been reverted back to original signatures and\nprototypes.\n\n```\n$ bin/vdexExtractor -i /tmp/Videos.vdex -o /tmp -f --dis -l /tmp/dis.log\n[INFO] Processing 1 file(s) from /tmp/Videos.vdex\n[INFO] 1 out of 1 Vdex files have been processed\n[INFO] 2 Dex files have been extracted in total\n[INFO] Extracted Dex files are available in '/tmp'\n$ head -90 /tmp/dis.log\n------ Dex Header Info ------\nmagic        : dex-035\nchecksum     : e14de163 (3779977571)\nsignature    : 9a91f8e5f2afe2c6b5c2b4853832d3c5ed01aef8\nfileSize     : 8ca638 (9217592)\nheaderSize   : 70 (112)\nendianTag    : 12345678 (305419896)\nlinkSize     : 0 (0)\nlinkOff      : 0 (0)\nmapOff       : 8ca568 (9217384)\nstringIdsSize: ef06 (61190)\nstringIdsOff : 70 (112)\ntypeIdsSize  : 29f4 (10740)\ntypeIdsOff   : 3bc88 (244872)\nprotoIdsSize : 3df9 (15865)\nprotoIdsOff  : 46458 (287832)\nfieldIdsSize : a79d (42909)\nfieldIdsOff  : 74c04 (478212)\nmethodIdsSize: fed7 (65239)\nmethodIdsOff : c88ec (821484)\nclassDefsSize: 2288 (8840)\nclassDefsOff : 147fa4 (1343396)\ndataSize     : 73d594 (7591316)\ndataOff      : 18d0a4 (1626276)\n-----------------------------\nfile #0: classDefsSize=8840\n  class #0: a.a ('La$a;')\n   access=0601 (PUBLIC INTERFACE ABSTRACT)\n   source_file=SourceFile, class_data_off=851907 (8722695)\n   static_fields=0, instance_fields=0, direct_methods=0, virtual_methods=2\n   virtual_method #0: onMenuItemSelected (La;Landroid/view/MenuItem;)Z\n    access=0401 (PUBLIC ABSTRACT)\n    codeOff=0 (0)\n   virtual_method #1: invokeItem (Landroid/support/v7/view/menu/MenuItemImpl;)Z\n    access=0401 (PUBLIC ABSTRACT)\n    codeOff=0 (0)\n  class #1: a.b ('La$b;')\n   access=0601 (PUBLIC INTERFACE ABSTRACT)\n   source_file=SourceFile, class_data_off=851913 (8722707)\n   static_fields=0, instance_fields=0, direct_methods=0, virtual_methods=1\n   virtual_method #0: invokeItem (Landroid/support/v7/view/menu/MenuItemImpl;)Z\n    access=0401 (PUBLIC ABSTRACT)\n    codeOff=0 (0)\n  class #2: SupportMenu ('Landroid/support/v4/internal/view/SupportMenu;')\n   access=0601 (PUBLIC INTERFACE ABSTRACT)\n   source_file=SourceFile, class_data_off=0 (0)\n  class #3: a ('La;')\n   access=0001 (PUBLIC)\n   source_file=SourceFile, class_data_off=85191b (8722715)\n   static_fields=1, instance_fields=25, direct_methods=12, virtual_methods=74\n   direct_method #0: \u003cclinit\u003e ()V\n    access=10008 (STATIC CONSTRUCTOR)\n    codeOff=1abb50 (1751888)\n    quickening_size=4 (4)\n      1abb60: 1260                                   |0000: const/4 v0, #int 6 // #6\n      1abb62: 2300 e426                              |0001: new-array v0, v0, [I // type@26e4\n      1abb66: 2600 0700 0000                         |0003: fill-array-data v0, 0000000a // +00000000\n      1abb6c: 6900 1900                              |0006: sput-object v0, La;.sCategoryToOrder:[I // field@0019\n      1abb70: 7300                                   |0008: return-void-no-barrier\n[new] 1abb70: 0e00                                   |0008: return-void\n      1abb72: 0000                                   |0009: nop // spacer\n      1abb74: 0003 0400 0600 0000 0100 0000 0400 ... |000a: array-data (16 units)\n   direct_method #1: invokeItem (Landroid/support/v7/view/menu/MenuItemImpl;)Z\n    access=10001 (PUBLIC CONSTRUCTOR)\n    codeOff=1abb94 (1751956)\n    quickening_size=22 (34)\n      1abba4: 1211                                   |0000: const/4 v1, #int 1 // #1\n      1abba6: 1200                                   |0001: const/4 v0, #int 0 // #0\n      1abba8: 7010 dbf9 0200                         |0002: invoke-direct {v2}, Ljava/lang/Object;.\u003cinit\u003e:()V // method@f9db\n      1abbae: e620 4000                              |0005: iput-quick v0, v2, [obj+0040]\n[new] 1abbae: 5920 0400                              |0005: iput v0, v2, La;.mDefaultShowAsAction:I // field@0004\n      1abbb2: eb20 4a00                              |0007: iput-boolean-quick v0, v2, [obj+004a]\n[new] 1abbb2: 5c20 1200                              |0007: iput-boolean v0, v2, La;.mPreventDispatchingItemsChanged:Z // field@0012\n      1abbb6: eb20 4700                              |0009: iput-boolean-quick v0, v2, [obj+0047]\n[new] 1abbb6: 5c20 0d00                              |0009: iput-boolean v0, v2, La;.mItemsChangedWhileDispatchPrevented:Z // field@000d\n      1abbba: eb20 4d00                              |000b: iput-boolean-quick v0, v2, [obj+004d]\n[new] 1abbba: 5c20 1600                              |000b: iput-boolean v0, v2, La;.mStructureChangedWhileDispatchPrevented:Z // field@0016\n      1abbbe: eb20 4800                              |000d: iput-boolean-quick v0, v2, [obj+0048]\n[new] 1abbbe: 5c20 0f00                              |000d: iput-boolean v0, v2, La;.mOptionalIconsVisible:Z // field@000f\n      1abbc2: eb20 4500                              |000f: iput-boolean-quick v0, v2, [obj+0045]\n[new] 1abbc2: 5c20 0a00                              |000f: iput-boolean v0, v2, La;.mIsClosing:Z // field@000a\n      1abbc6: 2200 fe25                              |0011: new-instance v0, Ljava/util/ArrayList; // type@25fe\n      1abbca: 7010 6bfb 0000                         |0013: invoke-direct {v0}, Ljava/util/ArrayList;.\u003cinit\u003e:()V // method@fb6b\n      1abbd0: e820 3800                              |0016: iput-object-quick v0, v2, [obj+0038]\n[new] 1abbd0: 5b20 1700                              |0016: iput-object v0, v2, La;.mTempShortcutItemList:Ljava/util/ArrayList; // field@0017\n      1abbd4: 2200 2c26                              |0018: new-instance v0, Ljava/util/concurrent/CopyOnWriteArrayList; // type@262c\n      1abbd8: 7010 cdfc 0000                         |001a: invoke-direct {v0}, Ljava/util/concurrent/CopyOnWriteArrayList;.\u003cinit\u003e:()V // method@fccd\n      1abbde: e820 3000                              |001d: iput-object-quick v0, v2, [obj+0030]\n[new] 1abbde: 5b20 1100                              |001d: iput-object v0, v2, La;.mPresenters:Ljava/util/concurrent/CopyOnWriteArrayList; // field@0011\n      1abbe2: e823 1000                              |001f: iput-object-quick v3, v2, [obj+0010]\n```\n\n## Compact Dex Converter\n\nThe Android 9 (Pie) release has introduced a new type of Dex file, the Compact Dex (Cdex). Cdex is\nan ART internal file format that is compacting various Dex data structs (e.g. method header) and\ndeduplicates common data blobs (e.g. strings) in multi-dex files. The deduplicated data from the\nDex files of an input application are stored in the shared section of the Vdex container.\n\nNow since the Vdex containers are storing Cdex files instead of standard Dex, the vdexExtractor\nbackends (starting from version 019) have been updated to support them too. However, since the tool\ndoes not implement a Dex IR it is not possible to convert a Cdex file back to standard Dex without\nusing an external tool. For this purpose the \"compact_dex_converter\" tool has been written, which\nuses the libdexlayout (Dex IR) from the AOSP art repo. The source code of the tool is available\n[here](https://gist.github.com/anestisb/30265097ad9a5ea2f0ddf7e36db3f07d). Compiling the tool\nrequires forking the necessary AOSP repos and building as an AOSP module.\n\nFor convenience vdexExtractor is implementing a helper tool (see \"tools/deodex\" in the following\nsection) that downloads a set of precompiled binaries and wraps around the required automation. In\naddition the \"compact_dex_converter\" binaries can be downloaded from the following links:\n\n* Linux x86-64\n  * With shared libraries: https://1drv.ms/u/s!ArDC4mvMyPrRhEsiuPjOF_ssIfOe\n  * With shared libraries **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhE3Z2jdBXJIhazjc\n  * Statically compiled: https://1drv.ms/u/s!ArDC4mvMyPrRhEq96XX-LsCACF2s\n  * Statically compiled **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhEwmwM8--zdhoCB2\n* Linux x86-64 old CPUs (no SSE4.2 \u0026 no POPCNT [#29](https://github.com/anestisb/vdexExtractor/issues/29))\n  * With shared libraries: https://1drv.ms/u/s!ArDC4mvMyPrRhFP46IyBqOtihS9s\n  * With shared libraries **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhFXEGW9vrlMlTKDJ\n  * Statically compiled: https://1drv.ms/u/s!ArDC4mvMyPrRhFIFZCF9TtEHVooc\n  * Statically compiled **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhFSMELB_H3w5Cdfe\n* ARM64 (aarch64)\n  * With shared libraries: https://1drv.ms/u/s!ArDC4mvMyPrRhEindMOf3aWCbQRr\n  * With shared libraries **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhEnU9Ei_3MeQipGr\n  * Statically compiled: NOT SUPPORTED\n* macOS\n  * With shared libraries: https://1drv.ms/u/s!ArDC4mvMyPrRhE45gEUNolEiZ50u\n  * With shared libraries **debug**: https://1drv.ms/u/s!ArDC4mvMyPrRhFG5WH_zNz0jNarZ\n  * Statically compiled: NOT SUPPORTED\n\nThe 's' suffix in binary names stands for \"statically compiled\" and the 'd' for \"debug\" build. They\ncan be also combined (e.g. 'ds' - statically compiled debug build).\n\n### Update 14 Sept. 2018\n\nA functionally equivalent upstream\n[patch](https://android-review.googlesource.com/c/platform/art/+/751510) to art's oatdump utility\nhas been contributed. AOSP master has merged, so hopefully it will ship with the next major OS\nupdate.\n\n\n## Utility Scripts\n\n* **scripts/extract-apps-from-device.sh**\n\n  Extract ART compiler output resources (oat, art, vdex) of installed packages (user and system)\n  from a connected Android device. Also supports extracting APK archives of installed packages. Some\n  system app data might fail to extract without root access due to applied DAC permissions.\n\n  ```text\n  $ scripts/extract-apps-from-device.sh -h\n    Usage: extract-apps-from-device.sh [options]\n      options:\n        -o|--output \u003cdir\u003e  : Output directory to save extracted data (default is '.')\n        -d|--device \u003cdevID\u003e: Device serial to use instead of default interactive selection\n        --system-apps      : Extract system apps too (default is user apps only)\n        --apks             : Extract apks (default is optimized files only)\n        -h|--help          : This help message\n  $ scripts/extract-apps-from-device.sh --system-apps -o /tmp/art_data --apks\n  [INFO]: Enumerating connected Android devices\n  [INFO]: Trying to extract data from '163' packages\n  [INFO]: Extracted data stored under '/tmp/art_data'\n  ```\n\n* **scripts/update-vdex-location-checksums.sh**\n\n  Update Vdex file location checksums with CRCs extracted from input Apk archive file. More\n  information on how this feature was used to trick the ART runtime book keeping mechanism and\n  bypass SafetyNet application integrity checks is available [here][census-snet].\n\n  ```text\n  $ scripts/update-vdex-location-checksums.sh -h\n    Usage: update-vdex-location-checksums.sh [options]\n      options:\n        -i|--input \u003cfile\u003e : Input Vdex file to repair location checksum(s) within\n        -a|--app \u003cfile\u003e   : Input Apk file to extract location checksum(s) from\n        -o|--output \u003cdir\u003e : Directory to save updated Vdex file (default is '.')\n        -h|--help         : This help message\n  ```\n\n* **tools/deodex/run.sh**\n\n  Helper tool to decompile (deodex) Vdex resources back to standard Dex files in a bulk manner. The\n  tool is automatically handling the case of CompactDex files (as introduced in Android Pie) and\n  uses the compact_dex_converter tool (more info\n  [here](https://github.com/anestisb/vdexExtractor/issues/23)) to convert back to StandardDex. Since\n  the converter is compiled as part of the AOSP sources, a set of binaries for Linux \u0026 maacOS is\n  maintained from the developer for convenience.\n\n  ```text\n  $ tools/deodex/run.sh -h\n    Usage: run.sh [options]\n      options:\n        -i|--input \u003cpath\u003e : Directory with Vdex files or single file\n        -o|--output \u003cdir\u003e : Directory to save deodex'ed resources (default is '.')\n        -k|--keep         : Keep intermediate files (default 'false')\n        -h|--help         : This help message\n\n  $ tools/deodex/run.sh -i /tmp/vdex_samples -o /tmp/deodexed_samples\n  [INFO]: Processing 140 input Vdex files\n  [INFO]: 140 binaries have been successfully deodexed\n  ```\n\n## Changelog\n\n* __0.6.0__ - 30 December 2019\n  * Vdex 021 support for Android Q (appreciate IgorEisberg contribution)\n  * Fix an issue in the method iterator of the Vdex 006 \u0026 010 backends\n  * Fix GCC 9 compilation issue\n* __0.5.2__ - 22 September 2018\n  * Fix an issue when decompiling framework bytecode the APIs of which have been hidden\n* __0.5.1__ - 3 September 2018\n  * Improve handling of deduplicated shared data section when exporting CompactDex files after\n    decompilation\n  * Fixes an OOB read issue in Vdex 010 decompiler\n  * Fix Dex output header formatting glitch due to different magic size of CompactDex \u0026 StandardDex\n  * Option (`--get-api`) to query Android API level of a Vdex file (mostly useful when scripting\n    around the tool)\n  * deodex helper tool and URLs for compact_dex_converter binaries for Linux \u0026 macOS\n* __0.5.0__ - 30 August 2018\n  * Vdex 019 support for Android Pie (verifier dependencies, decompiler \u0026 disassembler)\n  * Extended Dex file parsing library to support CompactDex files\n  * Extended disassembler engine to support CompactDex files as processed from the Android Pie\n    Vdex containers\n  * Improved input files sanity checks to avoid malformed Vdex crashing the tool\n  * Various bug fixes and disassembler output improvements\n* __0.4.1__ - 4 March 2018\n  * Fix Vdex 006 NOP decompilation issue\n  * Support multi-depth directory recursion for input path\n  * Argument to ignore CRC errors required for out-of-order optimized classes (see\n    [issue #3][issue3])\n* __0.4.0__ - 11 December 2017\n  * Add Vdex 010 (API-27) support by defining different parser \u0026 decompiler backend engines that are\n    version specific\n  * Fix a bug in verified dependencies iterator that presented results out of order\n  * Simplified command line arguments\n  * Deprecate class name recover information gather feature due to increased complexity in Vdex\n    parser engine\n  * Updated Dex API to support new opcodes \u0026 instruction formats\n* __0.3.1__ - 17 November 2017\n  * Add option to update checksum location of Vdex file (`-n, --new-crc`). Feature mostly targets\n    use-cases were a backwards compatibility fix of the Vdex file is required without having to\n    dex2oat recompile.\n  * Implement class name recover information gather feature (`-r, --class-recover`)\n  * Add timer utility functions to measure time spend to unquicken each input Vdex file\n  * Use external log file only for disassembler \u0026 verified dependencies information output\n  * Disassembler output performance improvements\n  * Improve performance when decompiling and disassembling at the same run\n  * Logging facility improvements\n  * Improve code quality by removing duplicate code\n* __0.3.0__ - 28 October 2017\n  * Implement Vdex verified dependencies information iterator (`-D, --dump-deps`)\n  * Enable Dex disassembler without requiring to unquicken bytecode\n  * Improve Dex disassembler output by resolving class \u0026 method definitions\n  * Improve Dex disassembler output by annotating classes \u0026 methods access flags\n  * Fixed a bug when printing number of class fields and method from Dex disassembler\n  * Utility script to automate extraction of ART compiler output resources from a device\n  * Dex file API improvements\n* __0.2.3__ - 16 October 2017\n  * Improve disassembler output when decompiling NOP instructions (effectively ignore spacers)\n* __0.2.2__ - 16 October 2017\n  * Fix UAF bug when processing multiple files\n* __0.2.1__ - 16 October 2017\n  * Option to save output to log file instead of (default) STDOUT (`-l, --log-file`)\n  * Dump Vdex header information with verbose debug option\n  * Fix minor memory leaks \u0026 memory corruptions in disassembler engine\n* __0.2.0__ - 16 October 2017\n  * Unquicken decompiler stable release (`-u, --unquicken`)\n  * Implement Dex bytecode disassembler (`-d, --disassemble`)\n* __0.1.1__ - 13 October 2017\n  * Unquicken decompiler beta release (`-u, --unquicken`)\n  * Allow override of output Dex files (`-f, --file-override`)\n* __0.1.0__ - 8 October 2017\n  * Initial release\n\n\n## ToDo\n\n* Disassembler performance \u0026 usability improvements\n\n\n## License\n\n```\n   Anestis Bechtsoudis \u003canestis@census-labs.com\u003e\n   Copyright 2017 - 2020 by CENSUS S.A. All Rights Reserved.\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n\n[vdex-cr]: https://android-review.googlesource.com/#/c/264514/\n[aosp-master]: https://android.googlesource.com/platform/art/+/a1f56a8dddb88f5377a7dd4ec79640103c713d30\n[oatdump-oreo]: https://gist.github.com/anestisb/71d6b0496912f801533dec9d264aa409\n[oatdump-plus]: https://github.com/anestisb/oatdump_plus/tree/oreo-release\n[census-snet]: https://census-labs.com/news/2017/11/17/examining-the-value-of-safetynet-attestation-as-an-application-integrity-security-control/\n[issue3]: https://github.com/anestisb/vdexExtractor/issues/3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fvdexextractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanestisb%2Fvdexextractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fvdexextractor/lists"}