Skip to content
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

Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: -1 #851

Open
SharkFall opened this issue Jun 23, 2022 · 0 comments

Comments

@SharkFall
Copy link

HI JesuFreke,thank you for your reading

this is all of the errors:
W/System.err: org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Landroid/support/v4/app/INotificationSideChannel;->ja(Ljava/lang/String;)Ljava/lang/String;
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058)
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354)
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309)
W/System.err: at sharkfall.inc.test.test(test.java:66)
W/System.err: Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x0
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331)
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054)
W/System.err: ... 15 more
W/System.err: Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: -1
W/System.err: at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
W/System.err: at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:183)
W/System.err: at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1240)
W/System.err: ... 16 more

this is smali method:
.method private static ja(Ljava/lang/String;)Ljava/lang/String;
.registers 6

new-instance v1, Ljava/lang/StringBuilder;

invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

invoke-virtual {p0}, Ljava/lang/String;->toCharArray()[C

move-result-object v2

const/4 v0, 0x0

:goto_a
array-length v3, v2

if-ge v0, v3, :cond_3e

rem-int/lit8 v3, v0, 0x4

packed-switch v3, :pswitch_data_44

aget-char v3, v2, v0

xor-int/lit8 v3, v3, -0x1

int-to-char v3, v3

invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

:goto_1a
add-int/lit8 v0, v0, 0x1

goto :goto_a

:pswitch_1d
aget-char v3, v2, v0

const v4, 0x40b27

xor-int/2addr v3, v4

int-to-char v3, v3

invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

goto :goto_1a

:pswitch_28
aget-char v3, v2, v0

const v4, 0x5863c4a9

xor-int/2addr v3, v4

int-to-char v3, v3

invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

goto :goto_1a

:pswitch_33
aget-char v3, v2, v0

const v4, 0x525978fe

xor-int/2addr v3, v4

int-to-char v3, v3

invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

goto :goto_1a

:cond_3e
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v0

return-object v0

nop

:pswitch_data_44
.packed-switch 0x0
    :pswitch_1d
    :pswitch_28
    :pswitch_33
.end packed-switch

.end method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant