-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Hi,
I was curious to test smali2java on a dissasembled apk but I have an exception:
`Found cso.smali
panic: runtime error: slice bounds out of range [:-1]
goroutine 1 [running]:
github.com/alexeysoshin/smali2java/parser.(*MethodParser).Parse(0xc0003a9810, 0xc0003a9a40, 0xc00012f630, 0x5, 0x5, 0x0, 0x0)
c:/Apps/ReverseEngineering/smali2java/parser/method.go:84 +0x206f
github.com/alexeysoshin/smali2java/parser.(*JavaFile).ParseLine(0xc0003a9a40, 0xc000147170, 0x2a, 0x0, 0x0)
c:/Apps/ReverseEngineering/smali2java/parser/java_file.go:117 +0x179e`
The problem is with the following lines:
.method public varargs abstract g([Lntb;)V .end method
Inside MethodParser.Parse the variable smaliMethod holds the strings "abstract" so the search for () fails and argumentsIndex/returnValueIndex are -1.
Update:
I have added the following lines to fix it:
if currentLine[methodNameIndex] == java.Abstract { staticOrAbstract = java.Abstract methodNameIndex++ }