Question

when i used smali to dex my mod file, I got this error:

patch\android\view\Choreographer.smali[1392,4] All register args must fit in 4 bits

I located to line 1392 and found:

invoke-direct {p0, p1, p2, p3}, Landroid/view/Choreographer;->MyFunc(JI)V 
invoke-static {}, Ljava/lang/System;->nanoTime()J  (line 1392)

move-result-wide v11

Does somebody know how do i fix it? I have read this post http://forum.xda-developers.com/showthread.php?t=733275, but it didn't help, because this line did not use any register.

Was it helpful?

Solution

The problem is on the first line

invoke-direct {p0, p1, p2, p3}, Landroid/view/Choreographer;->MyFunc(JI)V 

You can only use registers v0-v15, because the numeric register index must fit within 4 bits. The method apparently has a large number of registers, so that at least p3 maps to a register that is higher than v15.

Fortunately, the registers are contiguous, so the fix is simple

invoke-direct/range {p0 .. p3}, Landroid/view/Choreographer;->MyFunc(JI)V 

The /range variant accepts a contiguous range of registers, and can address up to v65535.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top