-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Exception occurred while writing code_item for method return of #1834 - think its not #1718 #2496
Comments
Building APK from split APKs generated by https://www.andnixsh.com/2020/06/sap-split-apks-packer-by-kirlif-windows.html So, restarted and decodes and builds ok! Clearly connected to my change in unrelated smali caused by logging instruction in unrelated smali: Log package missing? Found another occurrence: seems to be caused by an invalid instruction in .smali file. More news: |
@beaumontk |
So move eg. XXX.smal from smali folder to smali_classes2 folder? Aah! Not so simple! Duplicate the directory or move the whole directory? Working now! Thanks again |
As mentioned, the method limit was hit (unsigned short max) and thus moving files to a new dex file resolved it. Closing. |
Maybe this problem could be handled in a more dignified and explanatory way? |
brother what did you do to solve this problem can you explain.?
|
brother what did you do to solve this ? I'm using kali linux and same problem. |
The solve was in the answer you quoted. |
Information
apktool -version
) - 2.5.0Stacktrace/Logcat
C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool>"C:\Program Files\Java\jre1.8.0_181\bin\java.exe" -Xmx512m -jar C:\kb\apktool_2.3.4\apktool_2.5.0.jar -f b C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool\Connect_v
4_38_1_b5720_SAP -o C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool\KB_garmin_connect.apk
I: Using Apktool 2.5.0
I: Smaling smali folder into classes.dex...
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Lk2/a/a/a/v/e/c;->values()[Lk2/a/a/a/v/e/c;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1046)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:345)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:300)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:420)
at brut.androlib.Androlib.buildSources(Androlib.java:351)
at brut.androlib.Androlib.build(Androlib.java:303)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:259)
at brut.apktool.Main.main(Main.java:85)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x2
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1319)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java
:1042)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1279)
... 11 more
C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool>"C:\Program Files\Java\jre1.8.0_181\bin\java.exe" -Xmx512m -jar C:\kb\apktool_2.3.4\apktool_2.4.1.jar -f --verbose b C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool
\Connect_v4_38_1_b5720_SAP -o C:\kb\java_myApps\android\apktool_jadx\garmin_connect\apktool\KB_garmin_connect.apk
Jan 15, 2021 1:53:20 PM brut.androlib.Androlib build
INFO: Using Apktool 2.4.1
Jan 15, 2021 1:53:21 PM brut.androlib.Androlib buildSourcesSmali
INFO: Smaling smali folder into classes.dex...
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Lk2/a/a/a/v/e/c;->values()[Lk2/a/a/a/v/e/c;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:917)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:341)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:297)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:418)
at brut.androlib.Androlib.buildSources(Androlib.java:349)
at brut.androlib.Androlib.build(Androlib.java:301)
at brut.androlib.Androlib.build(Androlib.java:268)
at brut.apktool.Main.cmdBuild(Main.java:251)
at brut.apktool.Main.main(Main.java:79)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x2
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1190)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:913)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range:65536
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1150)
... 11 more
Steps to Reproduce
apktool
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(
.apks
that live in/system/framework
or/system/priv-app
)APK
If this APK can be freely shared, please upload/attach a link to it.
Questions to ask before submission
apktool d
,apktool b
without changing anything? yesThe text was updated successfully, but these errors were encountered: