几个月前,我编写了一个基本上捕获了签名的Android应用程序。几天前,我的笔记本电脑崩溃,我丢失了项目的代码。但是,我有用来反编译源代码的apk文件。但是,反编译的源代码对我来说有点难以消化。所以我开始在反编译代码的帮助下重新编码它。但是我碰到了一堵砖墙试图找出这个tableswitch
,它对应于我实际代码中的switch语句。 tableswitch
是
motionevent.getActionMasked();
JVM INSTR tableswitch 0 2: default 104
// 0 286
// 1 344
// 2 344;
goto _L1 _L2 _L3 _L3
_L1:
boolean flag;
paint.setStrokeWidth(f6);
Canvas canvas = bgCanvas;
Path path1 = bgPath;
Paint paint1 = paint;
canvas.drawPath(path1, paint1);
bgPath.reset();
Path path2 = bgPath;
float f7 = lastTouchX;
float f8 = lastTouchY;
path2.moveTo(f7, f8);
int i = (int)(dirtyRect.left - 5F);
int j = (int)(dirtyRect.top - 5F);
int k = (int)(dirtyRect.right + 5F);
int l = (int)(dirtyRect.bottom + 5F);
signature signature1 = this;
int i1 = i;
int j1 = j;
int k1 = k;
int l1 = l;
signature1.invalidate(i1, j1, k1, l1);
lastTouchX = f;
lastTouchY = f1;
lastStroke = f6;
lastPressure = f4;
flag = true;
_L4:
return flag;
_L2:
CustomPath custompath = path;
float f9 = f3;
custompath.moveTo(f, f1, f4, f9);
bgPath.moveTo(f, f1);
lastStroke = f6;
lastTouchX = f;
lastTouchY = f1;
lastPressure = f4;
flag = true;
if (true) goto _L4; else goto _L3
_L3:
resetDirtyRect(f, f1);
int i2 = motionevent.getHistorySize();
int j2 = 0;
do
{
label0:
{
if (j2 < i2)
{
break label0;
}
path.lineTo(f, f1, f4, f6);
if ((double)Math.abs(lastStroke - f6) >= 0.10000000000000001D)
{
Paint paint2 = paint;
float f10 = lastStroke;
paint2.setStrokeWidth(f10);
Canvas canvas1 = bgCanvas;
Path path3 = bgPath;
Paint paint3 = paint;
canvas1.drawPath(path3, paint3);
bgPath.reset();
Path path4 = bgPath;
float f11 = lastTouchX;
float f12 = lastTouchY;
path4.moveTo(f11, f12);
}
bgPath.lineTo(f, f1);
}
if (true)
{
continue;
}
float f13 = motionevent.getHistoricalX(j2);
float f14 = motionevent.getHistoricalY(j2);
float f15 = (float)Math.round(motionevent.getHistoricalPressure(j2) * 100F) / 100F;
float f16 = f15 * 10F;
float f17 = Math.max(1F, f16);
MotionEvent motionevent2 = motionevent;
byte byte1 = 25;
float f18 = motionevent2.getHistoricalAxisValue(byte1, j2);
path.lineTo(f13, f14, f15, f18);
if ((double)Math.abs(lastStroke - f17) >= 0.10000000000000001D)
{
Paint paint4 = paint;
float f19 = lastStroke;
paint4.setStrokeWidth(f19);
Canvas canvas2 = bgCanvas;
Path path5 = bgPath;
Paint paint5 = paint;
canvas2.drawPath(path5, paint5);
bgPath.reset();
Path path6 = bgPath;
float f20 = lastTouchX;
float f21 = lastTouchY;
path6.moveTo(f20, f21);
}
bgPath.lineTo(f13, f14);
lastTouchX = f13;
lastTouchY = f14;
lastStroke = f17;
j2++;
} while (true);
if (true) goto _L1; else goto _L5
_L5:
在我的实际代码中,switch case就是这样的
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
// codes here
break;
case MotionEvent.ACTION_MOVE:
// codes here
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// codes here
break;
default:
break;
}
问题是我无法弄清楚哪个Label对应哪种情况。任何人都可以对此有所了解吗?