[Google Pixel Questions & Answers] gudenau:
I have been wanting to mod some of the framework code on my Pixel XL to change some behaviors of my System, but I am not sure what to do exactly. When I try to extract odex files backsmali throws an ArrayOutOfBounds exception.

Here is what I did:

I downloaded backsmali 2.2.2 from here.

Ran `mkdir /sdcard/framework/ && cp /system/framework/* /sdcard/framework` as root on my phone.

Ran `adb pull /sdcard/framework` on my computer.

Ran `java -Xms1g -jar baksmali-2.2.2.jar x -d framework/arm64 framework/oat/arm64/services.odex -o services`

When using `less` to view the contents of the odex file it appears to be an ELF, is this normal for odex?

Phone software:

Android 8.1.0

Kernel 3.18.70-g520f6eb

Build OPM1.171019.012

Security patch January 5, 2018

Magisk v15.2

Edit:

Stack trace:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1889914952
at org.jf.dexlib2.dexbacked.BaseDexBuffer.readSmallUint(BaseDexBuffer.java:53)
at org.jf.dexlib2.dexbacked.OatFile$DexEntryIterator.next(OatFile.java:579)
at org.jf.dexlib2.dexbacked.OatFile$DexEntryIterator.next(OatFile.java:570)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at org.jf.util.AbstractForwardSequentialList$1.next(AbstractForwardSequentialList.java:91)
at java.util.AbstractSequentialList.get(AbstractSequentialList.java:88)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:129)
at org.jf.baksmali.DexInputCommand.loadDexFile(DexInputCommand.java:144)
at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:161)
at org.jf.baksmali.Main.main(Main.java:102)

SHA512 hashes:

86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/am.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/android.hidl.base-V1.0-java.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/android.hidl.manager-V1.0-java.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/android.test.mock.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/android.test.runner.jar
955480e9f99d8524975038753a090669eb928fa209b371e4dcbae22f3866431323d95e81a2ebe862fdc8bae9b43ac60dc67c74b11eb7d85c02ddfcd61ec1c274 framework/apache-xml.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/appwidget.jar
sha512sum: framework/arm: Is a directory
sha512sum: framework/arm64: Is a directory
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/bmgr.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/bouncycastle.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/bu.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.future.usb.accessory.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.ims.rcsmanager.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.location.provider.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.mediadrm.signer.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.media.remotedisplay.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.android.nfc_extras.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.google.android.camera.experimental2016.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.google.android.dialer.support.jar
650a1df9569c0ad2449a462a4967abda84dbb31a4eb94a8a79431a9a362608c0c4cb54d1b77ea0eed2d2f82c605c7f3ebf150c1d38da64159d98777e29ab5626 framework/com.google.android.maps.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.google.android.media.effects.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/com.google.vr.platform.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/conscrypt.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/content.jar
53d361f35953db7e414ce6115b91380788f8236816e722d51c1f1dafff5f0c2a32e6c87ba268298cfb522264a262f89ec9cd388708fe9d68c5a5687a17f6aef9 framework/core-libart.jar
197dcf115c82b1dcec72d6256a4ec667668aee06a5a9aa433f6514b89b704cf49d2f3f3beb728a25730b27b682ce938966c2a352ab9481a8db71c21545f4fb87 framework/core-oj.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/dpm.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/ethernet-service.jar
d36887847d069342fd8541b1f650843d2f05f774225edd2ddf01b39a7b30c788f3c47d864dc22ff14fcbaa6d7219ac410c968222d202dd57fec7b9803dd49d94 framework/ext.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/framework.jar
085085b2928148471bd70a400735e824c4f35b825cddbf8dbcce58b82a62dd3290bff6b33e48ef82bf6df366b868c27d403608cba9a85bd4ead5c894c2eae62a framework/framework-res.apk
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/hid.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/ime.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/ims-common.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/input.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/javax.obex.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/legacy-test.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/locksettings.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/media_cmd.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/monkey.jar
sha512sum: framework/oat: Is a directory
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/okhttp.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/org.apache.http.legacy.boot.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/pm.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/requestsync.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/services.jar
447463a1c9607706397882549ab7da07df249f96b3fbb95b2fb21889d7ca14f1cc90b22399e755bb1b70bac3e5322aeb9d4555da829023d6f96d75ff44281c5a framework/services.jar.prof
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/sm.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/svc.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/telecom.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/telephony-common.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/uiautomator.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/VerizonUnifiedSettings.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/voip-common.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/vr.jar
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/wifi-service.jar
bf9faef19fc1ff4b943466516692cc5faeaf3401729b1985792f764320e2748ed32e0fa0e0a715229b4d3423f5325bc22d3cf223524f447ef02195b679c00bcd framework/wifi-service.jar.prof
86d743c9591d9c6f7ef6d4a40b3af2bd1364ac9a9cd288a1161dab29cf08a694815cc8dde814983f3df1a0897501d65d37225a81c232d497398942df7a81e422 framework/wm.jar