-
Notifications
You must be signed in to change notification settings - Fork 48
Fix deodex-ing and disassembling of odex files for A12-A15 #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
---------------------------------------------------- dex2oat/linker/oat_writer.cc changes ---------------------------------------------------- 2020-09-30 Fields added: public_type_bss_mapping_offset_ and package_type_bss_mapping_offset_ Line 4127-4140 on commit 8f63f10: https://cs.android.com/android/_/android/platform/art/+/842b5cbd6e02232a3c407a98271a525f5e8aaf84:dex2oat/linker/oat_writer.cc;l=3881;bpv=1;bpt=0;drc=8f63f1084b013a129f66cf8a7ed8ab1cae9f02aa;dlc=e6c0f2a75bd969253279580e2e4772e54787034b Adds two +4 to offset (Present in line 673-676 on OatFile.java) ------------------- 2023-07-20 Field added: dex_file_sha1_ Line 3848-3852 on commit ba2222f: https://cs.android.com/android/_/android/platform/art/+/842b5cbd6e02232a3c407a98271a525f5e8aaf84:dex2oat/linker/oat_writer.cc;l=3881;dlc=5b65e02b1cdce48da11a972ab6d75a7fb5c859bd;bpv=1;bpt=0;drc=ba2222f1e114603b42dfdb6dd1d11012d32a2739 Adds +20 to offset (Present in line 644 on OatFile.java) ------------------- 2023-07-31 Field added: dex_file_magic_ Line 3846-3850 on commit 195e269: https://cs.android.com/android/_/android/platform/art/+/842b5cbd6e02232a3c407a98271a525f5e8aaf84:dex2oat/linker/oat_writer.cc;l=3881;dlc=5945a7f87d9fc36b3f8cede0b857f7967d56f702;bpv=1;bpt=0;drc=195e269dd1cd5128ba9d373a84d342a7b0d88cad Adds +8 to offset (Present in line 638 on OatFile.java) ------------------- 2024-01-03 Fields added: method_type_bss_mapping_offset Line 4018-4023 on commit 3f0981b: https://cs.android.com/android/_/android/platform/art/+/842b5cbd6e02232a3c407a98271a525f5e8aaf84:dex2oat/linker/oat_writer.cc;l=3881;dlc=f45b3e396d1a1b4a19a6253bf6ae9b8a59ebeec5;bpv=1;bpt=0;drc=3f0981b56a1b9a415383c552c063b890c840b13e Adds +4 to offset (Present in line 678 on OatFile.java) ----------------------------------------------------------------- runtime/oat.h changes (Moved to: runtime/oat/oat.h on 2024-01-03) ----------------------------------------------------------------- 2020-02-19 Field added: jni_dlsym_lookup_critical_trampoline_offset_ Line 129 on commit fa458ac2:- https://cs.android.com/android/_/android/platform/art/+/master:runtime/oat/oat.h;drf=runtime%2Foat.h;drc=fa458ac21af98b3bdde2c62ed86b9c192b994372;bpv=1;bpt=0;dlc=2925311f957f50bbec2b034c98877d22f702ee76;dlf=runtime%2Foat.h Adds +4 to offset (Line 262 on OatFile.java) -------------------- 2021-01-27 Field added: nterp_trampoline_offset_ Line 139 on commit c39af94:- https://cs.android.com/android/_/android/platform/art/+/master:runtime/oat/oat.h;drf=runtime%2Foat.h;drc=c39af9409ed4c8dd711be606f758a9b378cd0ee3;bpv=1;bpt=0;dlc=86d6cd53385eae365f16f45e1a5947cc6595eb63;dlf=runtime%2Foat.h Adds +4 to offset (Present in line 260 on OatFile.java) -------------------- 2022-03-09 Field added: bcp_bss_info_offset_ Line 135 on commit 69a87e3: https://cs.android.com/android/_/android/platform/art/+/master:runtime/oat/oat.h;drf=runtime%2Foat.h;drc=69a87e30730d0c6e6e5974fd2bd001f77fffed5e;bpv=1;bpt=0;dlc=1849c3a875aab44d9bff45623ec076b0331302f8;dlf=runtime%2Foat.h Adds +4 to offset (Present in line 258 on OatFile.java)
Thank you for the PR. I will check with the ART team before approving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from the ART team:
No objection (I have not verified that the CL is correct).
Best effort sounds good to me.
Overall, I don't understand the feature. I am not quite sure why
smali should be trying to understand oat files. My approach would be
that if file does not have the dex header, then scan the file linearly
for valid dex header.
Thank you for merging! I appreciate the feedback and the opportunity to contribute. |
Deodex and disassembling of odex/vdex files stopped working since A12 due to offset changes
Explanation to the main offset change are present inside commit description, here: 2100ac3
One can test it on termux for quick check:
java -jar baksmali-farJar.jar deodex base.odex -b $BOOTCLASSPATH
java -jar baksmali-farJar.jar dis base.odex