* Parse smali type descriptor to Java/Frida type string. * e.g. "Ljava/lang/String;" -> "java.lang.String" * "I" -> "int" * "[B" -> "[B"
(smaliType: string)
| 24 | * "[B" -> "[B" |
| 25 | */ |
| 26 | function smaliTypeToJava(smaliType: string): string { |
| 27 | if (smaliType.startsWith("[")) { |
| 28 | return smaliType; // keep array notation for Frida overload |
| 29 | } |
| 30 | switch (smaliType) { |
| 31 | case "V": |
| 32 | return "void"; |
| 33 | case "Z": |
| 34 | return "boolean"; |
| 35 | case "B": |
| 36 | return "byte"; |
| 37 | case "S": |
| 38 | return "short"; |
| 39 | case "C": |
| 40 | return "char"; |
| 41 | case "I": |
| 42 | return "int"; |
| 43 | case "J": |
| 44 | return "long"; |
| 45 | case "F": |
| 46 | return "float"; |
| 47 | case "D": |
| 48 | return "double"; |
| 49 | default: |
| 50 | if (smaliType.startsWith("L") && smaliType.endsWith(";")) { |
| 51 | return smaliType.slice(1, -1).replace(/\//g, "."); |
| 52 | } |
| 53 | return smaliType; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Parse smali method parameter list. |
no outgoing calls
no test coverage detected