smali.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE language SYSTEM "language.dtd"
  3. [
  4. <!ENTITY hex "[\da-fA-F]">
  5. <!ENTITY label "(?&lt;=^|\s|{)\:\w+">
  6. <!ENTITY typeIdentifiers "ZBSCIJFD">
  7. <!ENTITY fieldTypeLookBehind "\w\:">
  8. <!ENTITY fieldLookBehind "[\s,;\(\)]">
  9. <!ENTITY builtin "(javax?|dalvik|android)/[\w\$/]+">
  10. <!ENTITY float1 "\-?\d*(\d+\.|\.\d+|\d+)\d*[eE][\-\+]?\d+[dDfF]?\b">
  11. <!ENTITY float2 "\-?\d*(\d+\.|\.\d+)\d*[dDfF]?">
  12. <!ENTITY float3 "\-?\d+[dDfF]\b">
  13. <!ENTITY float4 "\-?0x&hex;*(\.|&hex;+)&hex;*[pP]\-?\d+[dDfF]?\b">
  14. ]>
  15. <language name="Smali" version="4" kateversion="5.0" section="Sources" extensions="*.smali" mimetype="text/x-smali" license="MIT">
  16. <highlighting>
  17. <list name="mnemonics">
  18. <item>nop</item>
  19. <item>move</item>
  20. <item>move/from16</item>
  21. <item>move/16</item>
  22. <item>move-wide</item>
  23. <item>move-wide/from16</item>
  24. <item>move-wide/16</item>
  25. <item>move-object</item>
  26. <item>move-object/from16</item>
  27. <item>move-object/16</item>
  28. <item>move-result</item>
  29. <item>move-result-wide</item>
  30. <item>move-result-object</item>
  31. <item>move-exception</item>
  32. <item>return-void</item>
  33. <item>return</item>
  34. <item>return-wide</item>
  35. <item>return-object</item>
  36. <item>const/4</item>
  37. <item>const/16</item>
  38. <item>const</item>
  39. <item>const/high16</item>
  40. <item>const-wide/16</item>
  41. <item>const-wide/32</item>
  42. <item>const-wide</item>
  43. <item>const-wide/high16</item>
  44. <item>const-string</item>
  45. <item>const-string/jumbo</item>
  46. <item>const-class</item>
  47. <item>monitor-enter</item>
  48. <item>monitor-exit</item>
  49. <item>check-cast</item>
  50. <item>instance-of</item>
  51. <item>array-length</item>
  52. <item>new-instance</item>
  53. <item>new-array</item>
  54. <item>filled-new-array</item>
  55. <item>filled-new-array/range</item>
  56. <item>fill-array-data</item>
  57. <item>throw</item>
  58. <item>goto</item>
  59. <item>goto/16</item>
  60. <item>goto/32</item>
  61. <item>packed-switch</item>
  62. <item>sparse-switch</item>
  63. <item>cmpl-float</item>
  64. <item>cmpg-float</item>
  65. <item>cmpl-double</item>
  66. <item>cmpg-double</item>
  67. <item>cmp-long</item>
  68. <item>if-eq</item>
  69. <item>if-ne</item>
  70. <item>if-lt</item>
  71. <item>if-ge</item>
  72. <item>if-gt</item>
  73. <item>if-le</item>
  74. <item>if-eqz</item>
  75. <item>if-nez</item>
  76. <item>if-ltz</item>
  77. <item>if-gez</item>
  78. <item>if-gtz</item>
  79. <item>if-lez</item>
  80. <item>aget</item>
  81. <item>aget-wide</item>
  82. <item>aget-object</item>
  83. <item>aget-boolean</item>
  84. <item>aget-byte</item>
  85. <item>aget-char</item>
  86. <item>aget-short</item>
  87. <item>aput</item>
  88. <item>aput-wide</item>
  89. <item>aput-object</item>
  90. <item>aput-boolean</item>
  91. <item>aput-byte</item>
  92. <item>aput-char</item>
  93. <item>aput-short</item>
  94. <item>iget</item>
  95. <item>iget-wide</item>
  96. <item>iget-object</item>
  97. <item>iget-boolean</item>
  98. <item>iget-byte</item>
  99. <item>iget-char</item>
  100. <item>iget-short</item>
  101. <item>iput</item>
  102. <item>iput-wide</item>
  103. <item>iput-object</item>
  104. <item>iput-boolean</item>
  105. <item>iput-byte</item>
  106. <item>iput-char</item>
  107. <item>iput-short</item>
  108. <item>sget</item>
  109. <item>sget-wide</item>
  110. <item>sget-object</item>
  111. <item>sget-boolean</item>
  112. <item>sget-byte</item>
  113. <item>sget-char</item>
  114. <item>sget-short</item>
  115. <item>sput</item>
  116. <item>sput-wide</item>
  117. <item>sput-object</item>
  118. <item>sput-boolean</item>
  119. <item>sput-byte</item>
  120. <item>sput-char</item>
  121. <item>sput-short</item>
  122. <item>invoke-virtual</item>
  123. <item>invoke-super</item>
  124. <item>invoke-direct</item>
  125. <item>invoke-static</item>
  126. <item>invoke-interface</item>
  127. <item>invoke-virtual/range</item>
  128. <item>invoke-super/range</item>
  129. <item>invoke-direct/range</item>
  130. <item>invoke-static/range</item>
  131. <item>invoke-interface/range</item>
  132. <item>neg-int</item>
  133. <item>not-int</item>
  134. <item>neg-long</item>
  135. <item>not-long</item>
  136. <item>neg-float</item>
  137. <item>neg-double</item>
  138. <item>int-to-long</item>
  139. <item>int-to-float</item>
  140. <item>int-to-double</item>
  141. <item>long-to-int</item>
  142. <item>long-to-float</item>
  143. <item>long-to-double</item>
  144. <item>float-to-int</item>
  145. <item>float-to-long</item>
  146. <item>float-to-double</item>
  147. <item>double-to-int</item>
  148. <item>double-to-long</item>
  149. <item>double-to-float</item>
  150. <item>int-to-byte</item>
  151. <item>int-to-char</item>
  152. <item>int-to-short</item>
  153. <item>add-int</item>
  154. <item>sub-int</item>
  155. <item>mul-int</item>
  156. <item>div-int</item>
  157. <item>rem-int</item>
  158. <item>and-int</item>
  159. <item>or-int</item>
  160. <item>xor-int</item>
  161. <item>shl-int</item>
  162. <item>shr-int</item>
  163. <item>ushr-int</item>
  164. <item>add-long</item>
  165. <item>sub-long</item>
  166. <item>mul-long</item>
  167. <item>div-long</item>
  168. <item>rem-long</item>
  169. <item>and-long</item>
  170. <item>or-long</item>
  171. <item>xor-long</item>
  172. <item>shl-long</item>
  173. <item>shr-long</item>
  174. <item>ushr-long</item>
  175. <item>add-float</item>
  176. <item>sub-float</item>
  177. <item>mul-float</item>
  178. <item>div-float</item>
  179. <item>rem-float</item>
  180. <item>add-double</item>
  181. <item>sub-double</item>
  182. <item>mul-double</item>
  183. <item>div-double</item>
  184. <item>rem-double</item>
  185. <item>add-int/2addr</item>
  186. <item>sub-int/2addr</item>
  187. <item>mul-int/2addr</item>
  188. <item>div-int/2addr</item>
  189. <item>rem-int/2addr</item>
  190. <item>and-int/2addr</item>
  191. <item>or-int/2addr</item>
  192. <item>xor-int/2addr</item>
  193. <item>shl-int/2addr</item>
  194. <item>shr-int/2addr</item>
  195. <item>ushr-int/2addr</item>
  196. <item>add-long/2addr</item>
  197. <item>sub-long/2addr</item>
  198. <item>mul-long/2addr</item>
  199. <item>div-long/2addr</item>
  200. <item>rem-long/2addr</item>
  201. <item>and-long/2addr</item>
  202. <item>or-long/2addr</item>
  203. <item>xor-long/2addr</item>
  204. <item>shl-long/2addr</item>
  205. <item>shr-long/2addr</item>
  206. <item>ushr-long/2addr</item>
  207. <item>add-float/2addr</item>
  208. <item>sub-float/2addr</item>
  209. <item>mul-float/2addr</item>
  210. <item>div-float/2addr</item>
  211. <item>rem-float/2addr</item>
  212. <item>add-double/2addr</item>
  213. <item>sub-double/2addr</item>
  214. <item>mul-double/2addr</item>
  215. <item>div-double/2addr</item>
  216. <item>rem-double/2addr</item>
  217. <item>add-int/lit16</item>
  218. <item>rsub-int</item>
  219. <item>mul-int/lit16</item>
  220. <item>div-int/lit16</item>
  221. <item>rem-int/lit16</item>
  222. <item>and-int/lit16</item>
  223. <item>or-int/lit16</item>
  224. <item>xor-int/lit16</item>
  225. <item>add-int/lit8</item>
  226. <item>rsub-int/lit8</item>
  227. <item>mul-int/lit8</item>
  228. <item>div-int/lit8</item>
  229. <item>rem-int/lit8</item>
  230. <item>and-int/lit8</item>
  231. <item>or-int/lit8</item>
  232. <item>xor-int/lit8</item>
  233. <item>shl-int/lit8</item>
  234. <item>shr-int/lit8</item>
  235. <item>ushr-int/lit8</item>
  236. <item>iget-volatile</item>
  237. <item>iput-volatile</item>
  238. <item>sget-volatile</item>
  239. <item>sput-volatile</item>
  240. <item>iget-object-volatile</item>
  241. <item>iget-wide-volatile</item>
  242. <item>iput-wide-volatile</item>
  243. <item>sget-wide-volatile</item>
  244. <item>sput-wide-volatile</item>
  245. <item>sget-object-volatile</item>
  246. <item>throw-verification-error</item>
  247. <item>execute-inline</item>
  248. <item>execute-inline/range</item>
  249. <item>invoke-object-init/range</item>
  250. <item>return-void-barrier</item>
  251. <item>iget-quick</item>
  252. <item>invoke-polymorphic</item>
  253. <item>invoke-polymorphic/range</item>
  254. <item>invoke-custom</item>
  255. <item>invoke-custom/range</item>
  256. <item>const-method-handle</item>
  257. <item>const-method-type</item>
  258. </list>
  259. <list name="keywords">
  260. <!-- Access flags -->
  261. <item>public</item>
  262. <item>private</item>
  263. <item>protected</item>
  264. <item>static</item>
  265. <item>final</item>
  266. <item>synchronized</item>
  267. <item>volatile</item>
  268. <item>bridge</item>
  269. <item>transient</item>
  270. <item>varargs</item>
  271. <item>native</item>
  272. <item>interface</item>
  273. <item>abstract</item>
  274. <item>strictfp</item>
  275. <item>synthetic</item>
  276. <item>annotation</item>
  277. <item>enum</item>
  278. <item>constructor</item>
  279. <item>declared-synchronized</item>
  280. <!-- Visibility values -->
  281. <item>build</item>
  282. <item>runtime</item>
  283. <item>system</item>
  284. </list>
  285. <contexts>
  286. <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
  287. <WordDetect attribute="Attribute" String=".class" context="#stay" />
  288. <WordDetect attribute="Attribute" String=".super" context="#stay" />
  289. <WordDetect attribute="Attribute" String=".implements" context="#stay" />
  290. <WordDetect attribute="Attribute" String=".source" context="#stay" />
  291. <WordDetect attribute="Attribute" String=".field" context="#stay" />
  292. <RegExpr attribute="Attribute" String="\.end\s+field" firstNonSpace="true" context="#stay" />
  293. <WordDetect attribute="Attribute" String=".annotation" context="Annotation" beginRegion="Annotation" />
  294. <WordDetect attribute="Attribute" String=".subannotation" context="#stay" />
  295. <RegExpr attribute="Attribute" String="\.end\s+subannotation" firstNonSpace="true" context="#stay" />
  296. <WordDetect attribute="Attribute" String=".enum" context="#stay" />
  297. <WordDetect attribute="Attribute" String=".method" context="MethodDeclaration" beginRegion="Method" />
  298. <keyword attribute="Keyword" context="#stay" String="keywords" />
  299. <IncludeRules context="Global" />
  300. </context>
  301. <context attribute="Normal Text" lineEndContext="#stay" name="Literal">
  302. <WordDetect attribute="Bool" String="true" context="#stay" />
  303. <WordDetect attribute="Bool" String="false" context="#stay" />
  304. <WordDetect attribute="Float" String="-infinity" insensitive="true" context="#stay" />
  305. <WordDetect attribute="Float" String="infinity" insensitive="true" context="#stay" />
  306. <WordDetect attribute="Float" String="-infinityD" insensitive="true" context="#stay" />
  307. <WordDetect attribute="Float" String="infinityD" insensitive="true" context="#stay" />
  308. <WordDetect attribute="Float" String="-infinityF" insensitive="true" context="#stay" />
  309. <WordDetect attribute="Float" String="infinityF" insensitive="true" context="#stay" />
  310. <WordDetect attribute="Float" String="NaN" insensitive="true" context="#stay" />
  311. <WordDetect attribute="Float" String="NaND" insensitive="true" context="#stay" />
  312. <WordDetect attribute="Float" String="NaNF" insensitive="true" context="#stay" />
  313. <RegExpr attribute="Float" context="#stay" String="&float1;|&float2;|&float3;|&float4;" />
  314. <RegExpr attribute="Hex" context="#stay" String="\-?0x&hex;+[LtTsS]?\b" />
  315. <RegExpr attribute="Decimal" context="#stay" String="\-?\d+[tTLsS]?\b" />
  316. <HlCChar attribute="Char" context="#stay" />
  317. <RegExpr attribute="Char" context="#stay" String="'\\u&hex;{4}'" />
  318. <DetectChar attribute="String" context="String" char="&quot;" />
  319. </context>
  320. <context attribute="Normal Text" lineEndContext="#stay" name="Global">
  321. <DetectChar attribute="Comment" context="Comment" char="#" />
  322. <RegExpr attribute="Method" context="#stay" String="\b[\w\$]+\s*(?=\s*>?\s*\()" />
  323. <RegExpr attribute="Field" context="#stay" String="\b[\w\$]+\s*(?=\:)" />
  324. <IncludeRules context="Literal" />
  325. <RegExpr attribute="Built-in" context="#stay" String="((?&lt;=&fieldTypeLookBehind;L)|(?&lt;=&fieldLookBehind;L)|(?&lt;=\[L)|(?&lt;=[&typeIdentifiers;]L))&builtin;" />
  326. <RegExpr attribute="Data Type" context="#stay" String="((?&lt;=&fieldTypeLookBehind;L)|(?&lt;=&fieldLookBehind;L)|(?&lt;=\[L)|(?&lt;=[&typeIdentifiers;]L))[\w/\$]+" />
  327. <RegExpr attribute="Type Identifier" context="#stay" String="((?&lt;=&fieldTypeLookBehind;)|(?&lt;=&fieldLookBehind;)(\[*[&typeIdentifiers;])*)\[*([&typeIdentifiers;]|L)|(?&lt;=[;&typeIdentifiers;\(]\))V" />
  328. <Detect2Chars attribute="Operator" context="#stay" char="." char1="." />
  329. <AnyChar attribute="Symbol" context="#stay" String="{}&lt;&gt;:;=()" />
  330. </context>
  331. <context attribute="Normal Text" lineEndContext="Method" name="MethodDeclaration">
  332. <keyword attribute="Keyword" context="#stay" String="keywords" />
  333. <IncludeRules context="Global" />
  334. </context>
  335. <context attribute="Normal Text" lineEndContext="#stay" name="Method">
  336. <WordDetect attribute="Attribute" String=".registers" context="#stay" />
  337. <WordDetect attribute="Attribute" String=".locals" context="#stay" />
  338. <WordDetect attribute="Attribute" String=".annotation" context="Annotation" beginRegion="Annotation" />
  339. <WordDetect attribute="Attribute" String=".array-data" context="ArrayData" beginRegion="ArrayData" />
  340. <WordDetect attribute="Attribute" String=".packed-switch" context="PackedSwitch" beginRegion="PackedSwitch" />
  341. <WordDetect attribute="Attribute" String=".sparse-switch" context="SparseSwitch" beginRegion="SparseSwitch" />
  342. <WordDetect attribute="Attribute" String=".catch" context="#stay" />
  343. <WordDetect attribute="Attribute" String=".catchall" context="#stay" />
  344. <WordDetect attribute="Attribute" String=".line" context="#stay" />
  345. <WordDetect attribute="Attribute" String=".param" context="Param" />
  346. <WordDetect attribute="Attribute" String=".local" context="#stay" />
  347. <RegExpr attribute="Attribute" String="\.end\s+param|\.(end|restart)\s+local" firstNonSpace="true" context="#stay" />
  348. <RegExpr attribute="Attribute" String="\.end\s+method" firstNonSpace="true" context="#pop#pop" endRegion="Method" />
  349. <WordDetect attribute="Attribute" String=".prologue" context="#stay" />
  350. <WordDetect attribute="Attribute" String=".epilogue" context="#stay" />
  351. <keyword attribute="Mnemonic" context="#stay" String="mnemonics" />
  352. <RegExpr attribute="Register" context="#stay" String="\b(v|p)[0-9]+\b" />
  353. <RegExpr attribute="Label" context="#stay" String="&label;" />
  354. <Detect2Chars attribute="Operator" context="#stay" char="-" char1=">" />
  355. <IncludeRules context="Global" />
  356. </context>
  357. <context attribute="Annotation" lineEndContext="AnnotationBody" name="Annotation">
  358. <IncludeRules context="Global" />
  359. <keyword attribute="Keyword" context="#stay" String="keywords" />
  360. </context>
  361. <context attribute="Attribute" lineEndContext="#stay" name="AnnotationBody">
  362. <IncludeRules context="Global" />
  363. <RegExpr attribute="Attribute" String="\.end\s+annotation" firstNonSpace="true" context="#pop#pop" endRegion="Annotation" />
  364. </context>
  365. <context attribute="Attribute" lineEndContext="PackedSwitchBody" name="PackedSwitch">
  366. <IncludeRules context="Literal" />
  367. </context>
  368. <context attribute="Normal Text" lineEndContext="#stay" name="PackedSwitchBody">
  369. <DetectChar attribute="Comment" context="Comment" char="#" />
  370. <RegExpr attribute="Label" context="#stay" String="&label;" />
  371. <RegExpr attribute="Attribute" String="\.end\s+packed\-switch" firstNonSpace="true" context="#pop#pop" endRegion="PackedSwitch" />
  372. </context>
  373. <context attribute="Attribute" lineEndContext="SparseSwitchBody" name="SparseSwitch">
  374. <IncludeRules context="Literal" />
  375. </context>
  376. <context attribute="Normal Text" lineEndContext="#stay" name="SparseSwitchBody">
  377. <DetectChar attribute="Comment" context="Comment" char="#" />
  378. <IncludeRules context="Literal" />
  379. <RegExpr attribute="Label" context="#stay" String="&label;" />
  380. <Detect2Chars attribute="Operator" context="#stay" char="-" char1=">" />
  381. <RegExpr attribute="Attribute" String="\.end\s+sparse\-switch" firstNonSpace="true" context="#pop#pop" endRegion="SparseSwitch" />
  382. </context>
  383. <context attribute="Normal Text" lineEndContext="ArrayDataBody" name="ArrayData">
  384. <IncludeRules context="Literal" />
  385. </context>
  386. <context attribute="Normal Text" lineEndContext="#stay" name="ArrayDataBody">
  387. <DetectChar attribute="Comment" context="Comment" char="#" />
  388. <IncludeRules context="Literal" />
  389. <RegExpr attribute="Attribute" String="\.end\s+array\-data" firstNonSpace="true" context="#pop#pop" endRegion="ArrayData" />
  390. </context>
  391. <context attribute="Normal Text" lineEndContext="#pop" name="Param">
  392. <RegExpr attribute="Register" context="#stay" String="\bp[0-9]+\b" />
  393. <RegExpr attribute="Variable" context="#stay" String="(?&lt;=,)\s*[\w]+" />
  394. <IncludeRules context="Literal" />
  395. </context>
  396. <context attribute="String" lineEndContext="#pop" name="String">
  397. <LineContinue attribute="String" context="#stay"/>
  398. <HlCStringChar attribute="String Char" context="#stay"/>
  399. <RegExpr attribute="String Char" context="#stay" String="\\u[0-9a-fA-F]{4}"/>
  400. <DetectChar attribute="String" context="#pop" char="&quot;"/>
  401. </context>
  402. <context attribute="Comment" lineEndContext="#pop" name="Comment">
  403. <DetectSpaces />
  404. <IncludeRules context="##Comments"/>
  405. </context>
  406. </contexts>
  407. <itemDatas>
  408. <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" />
  409. <itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false" />
  410. <itemData name="Annotation" defStyleNum="dsAttribute" spellChecking="false" />
  411. <itemData name="Mnemonic" defStyleNum="dsKeyword" spellChecking="false" />
  412. <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" />
  413. <itemData name="Method" defStyleNum="dsFunction" spellChecking="false" />
  414. <itemData name="Register" defStyleNum="dsVariable" spellChecking="false" />
  415. <itemData name="Field" defStyleNum="dsVariable" spellChecking="false" />
  416. <itemData name="Variable" defStyleNum="dsVariable" />
  417. <itemData name="Operator" defStyleNum="dsOperator" spellChecking="false" />
  418. <itemData name="Type Identifier" defStyleNum="dsDataType" italic="true" spellChecking="false" />
  419. <itemData name="Data Type" defStyleNum="dsDataType" italic="false" spellChecking="false" />
  420. <itemData name="Label" defStyleNum="dsOthers" spellChecking="false" />
  421. <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false" />
  422. <itemData name="Bool" defStyleNum="dsBaseN" spellChecking="false" />
  423. <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false" />
  424. <itemData name="Float" defStyleNum="dsFloat" spellChecking="false" />
  425. <itemData name="Char" defStyleNum="dsChar" spellChecking="false" />
  426. <itemData name="String" defStyleNum="dsString" />
  427. <itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false" />
  428. <itemData name="Comment" defStyleNum="dsComment" />
  429. <itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false" />
  430. <itemData name="Built-in" defStyleNum="dsBuiltIn" spellChecking="false" />
  431. </itemDatas>
  432. </highlighting>
  433. <general>
  434. <comments>
  435. <comment name="singleLine" start="#" position="afterwhitespace"/>
  436. </comments>
  437. <keywords casesensitive="1" weakDeliminator="-/[$" />
  438. </general>
  439. </language>
  440. <!-- kate: replace-tabs on; tab-width 4; indent-width 4; -->