0

What are the legal names for a smali label?

I know a-z and _ is legal and \n isn't obviously, but are there any rules regarding the label names?

I know the bytecode doesn't use the labels and the dalvik assembler (smali) converts it to position in the file, so it shouldn't really matter, but what would smali accept as a label name?

cyberhicham
  • 495
  • 1
  • 10
  • 24
Xonar
  • 1,296
  • 1
  • 14
  • 21

1 Answers1

1

Smali uses the same set of characters for label names as for any other identifier. The valid characters are defined in the SimpleName section of the dex specification.

SimpleName → SimpleNameChar (SimpleNameChar)*
SimpleNameChar →
    'A' … 'Z'
  | 'a' … 'z'
  | '0' … '9'
  | '$'
  | '-'
  | '_'
  | U+00a1 … U+1fff
  | U+2010 … U+2027
  | U+2030 … U+d7ff
  | U+e000 … U+ffef
  | U+10000 … U+10ffff
JesusFreke
  • 19,784
  • 5
  • 65
  • 68