最近在学习反编译,拿一个小apk来练习,反编译后都是些看不懂的if for、if while结构,还带label标签
public Painter(Context paramContext, ViewGroup.LayoutParams paramLayoutParams, Drawable paramDrawable, float paramFloat)
{
super(paramContext);
int i = this.needle.getWidth();
int j = this.needle.getHeight();
this.needleCenterX = (i / 2.0F);
this.needleCenterY = (j / 2.0F);
int k = this.compass.getWidth();
int m = this.compass.getHeight();
int n = k / 2;
int i1 = m / 2;
this.needleOffsetX = (n - this.needleCenterX);
this.needleOffsetY = (i1 - this.needleCenterY);
if (j > i);
for (int i2 = j; ; i2 = i)
{
(i2 / 2);
(360000 / CompassActivity.height);
(216000 / CompassActivity.width);
(360000 / CompassActivity.height);
(216000 / CompassActivity.width);
int i3 = this.background.getWidth();
int i4 = this.background.getHeight();
this.bgSrc = new Rect(i3 / 10, (i4 - i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height) / 2, i3 * 9 / 10, (i4 - i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height) / 2 + i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height);
this.bgDest = new Rect(0, 0, 8 * CompassActivity.width / 10, 8 * CompassActivity.width / 10);
this.matrix0 = new Matrix();
this.matrix = new Matrix();
this.matrix2 = new Matrix();
this.needlePaint = new Paint();
this.needlePaint.setFilterBitmap(true);
paramLayoutParams.width = k;
paramLayoutParams.height = m;
setLayoutParams(paramLayoutParams);
SurfaceHolder localSurfaceHolder = getHolder();
localSurfaceHolder.setSizeFromLayout();
localSurfaceHolder.addCallback(this);
return;
}
}private void onPaint(long paramLong, boolean paramBoolean)
{
SurfaceHolder localSurfaceHolder = getHolder();
Canvas localCanvas;
float f1;
float f2;
if (paramBoolean)
{
localCanvas = localSurfaceHolder.lockCanvas();
if (localCanvas != null)
{
f1 = this.degrees - this.currentDegrees;
f2 = this.degrees2 - this.currentDegrees2;
if (Math.abs(f1) >= 180.0F)
{
if (f1 <= 0.0F)
break label357;
f1 -= 360.0F;
}
label71: if (Math.abs(f2) >= 180.0F)
{
if (f2 <= 0.0F)
break label367;
f2 -= 360.0F;
}
label96: this.currentDegrees = ((float)(this.currentDegrees + 0.08500000000000001D * f1));
this.currentDegrees2 = ((float)(this.currentDegrees2 + 0.08500000000000001D * f2));
if (this.currentDegrees < 0.0F)
break label377;
if (this.currentDegrees > 360.0F)
this.currentDegrees -= 360.0F;
label162: if (this.currentDegrees2 < 0.0F)
break label391;
if (this.currentDegrees2 <= 360.0F);
}
}
label391: for (this.currentDegrees2 -= 360.0F; ; this.currentDegrees2 = (360.0F + this.currentDegrees2))
{
this.matrix.setRotate(this.currentDegrees, this.needleCenterX, this.needleCenterY);
this.matrix.postTranslate(this.needleOffsetX, this.needleOffsetY);
this.matrix2.setRotate(this.degrees2, this.needleCenterX, this.needleCenterY);
this.matrix2.postTranslate(this.needleOffsetX, this.needleOffsetY);
localCanvas.drawBitmap(this.background, this.bgSrc, this.bgDest, null);
localCanvas.drawBitmap(this.needle, this.matrix, this.needlePaint);
localCanvas.drawBitmap(this.haido, this.matrix0, this.needlePaint);
localCanvas.drawBitmap(this.compass, this.matrix2, this.needlePaint);
localSurfaceHolder.unlockCanvasAndPost(localCanvas);
return;
localCanvas = localSurfaceHolder.lockCanvas(this.bgDest2);
break;
label357: f1 += 360.0F;
break label71;
label367: f2 += 360.0F;
break label96;
label377: this.currentDegrees = (360.0F + this.currentDegrees);
break label162;
}
}public void surfaceCreated(SurfaceHolder paramSurfaceHolder)
{
this.runDrawingThread = true;
new Thread(new Runnable()
{
public void run()
{
long l1 = System.currentTimeMillis();
long l2 = 0L;
int i = 0;
if (!Painter.this.runDrawingThread)
return;
long l3 = System.currentTimeMillis();
if (i < 2)
{
Painter.this.onPaint(l3, true);
i++;
}
while (true)
{
while (true)
{
if ((l3 - l2) / 1000L >= 1L)
l2 = l3;
l1 += 16L;
long l4 = l1 - l3;
if (l4 < 0L)
break;
try
{
Thread.sleep(l4);
}
catch (Exception localException)
{
}
}
break;
Painter.this.onPaint(l3, false);
}
}
}).start();
}
public Painter(Context paramContext, ViewGroup.LayoutParams paramLayoutParams, Drawable paramDrawable, float paramFloat)
{
super(paramContext);
int i = this.needle.getWidth();
int j = this.needle.getHeight();
this.needleCenterX = (i / 2.0F);
this.needleCenterY = (j / 2.0F);
int k = this.compass.getWidth();
int m = this.compass.getHeight();
int n = k / 2;
int i1 = m / 2;
this.needleOffsetX = (n - this.needleCenterX);
this.needleOffsetY = (i1 - this.needleCenterY);
if (j > i);
for (int i2 = j; ; i2 = i)
{
(i2 / 2);
(360000 / CompassActivity.height);
(216000 / CompassActivity.width);
(360000 / CompassActivity.height);
(216000 / CompassActivity.width);
int i3 = this.background.getWidth();
int i4 = this.background.getHeight();
this.bgSrc = new Rect(i3 / 10, (i4 - i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height) / 2, i3 * 9 / 10, (i4 - i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height) / 2 + i4 * (8 * CompassActivity.width) / 10 / CompassActivity.height);
this.bgDest = new Rect(0, 0, 8 * CompassActivity.width / 10, 8 * CompassActivity.width / 10);
this.matrix0 = new Matrix();
this.matrix = new Matrix();
this.matrix2 = new Matrix();
this.needlePaint = new Paint();
this.needlePaint.setFilterBitmap(true);
paramLayoutParams.width = k;
paramLayoutParams.height = m;
setLayoutParams(paramLayoutParams);
SurfaceHolder localSurfaceHolder = getHolder();
localSurfaceHolder.setSizeFromLayout();
localSurfaceHolder.addCallback(this);
return;
}
}private void onPaint(long paramLong, boolean paramBoolean)
{
SurfaceHolder localSurfaceHolder = getHolder();
Canvas localCanvas;
float f1;
float f2;
if (paramBoolean)
{
localCanvas = localSurfaceHolder.lockCanvas();
if (localCanvas != null)
{
f1 = this.degrees - this.currentDegrees;
f2 = this.degrees2 - this.currentDegrees2;
if (Math.abs(f1) >= 180.0F)
{
if (f1 <= 0.0F)
break label357;
f1 -= 360.0F;
}
label71: if (Math.abs(f2) >= 180.0F)
{
if (f2 <= 0.0F)
break label367;
f2 -= 360.0F;
}
label96: this.currentDegrees = ((float)(this.currentDegrees + 0.08500000000000001D * f1));
this.currentDegrees2 = ((float)(this.currentDegrees2 + 0.08500000000000001D * f2));
if (this.currentDegrees < 0.0F)
break label377;
if (this.currentDegrees > 360.0F)
this.currentDegrees -= 360.0F;
label162: if (this.currentDegrees2 < 0.0F)
break label391;
if (this.currentDegrees2 <= 360.0F);
}
}
label391: for (this.currentDegrees2 -= 360.0F; ; this.currentDegrees2 = (360.0F + this.currentDegrees2))
{
this.matrix.setRotate(this.currentDegrees, this.needleCenterX, this.needleCenterY);
this.matrix.postTranslate(this.needleOffsetX, this.needleOffsetY);
this.matrix2.setRotate(this.degrees2, this.needleCenterX, this.needleCenterY);
this.matrix2.postTranslate(this.needleOffsetX, this.needleOffsetY);
localCanvas.drawBitmap(this.background, this.bgSrc, this.bgDest, null);
localCanvas.drawBitmap(this.needle, this.matrix, this.needlePaint);
localCanvas.drawBitmap(this.haido, this.matrix0, this.needlePaint);
localCanvas.drawBitmap(this.compass, this.matrix2, this.needlePaint);
localSurfaceHolder.unlockCanvasAndPost(localCanvas);
return;
localCanvas = localSurfaceHolder.lockCanvas(this.bgDest2);
break;
label357: f1 += 360.0F;
break label71;
label367: f2 += 360.0F;
break label96;
label377: this.currentDegrees = (360.0F + this.currentDegrees);
break label162;
}
}public void surfaceCreated(SurfaceHolder paramSurfaceHolder)
{
this.runDrawingThread = true;
new Thread(new Runnable()
{
public void run()
{
long l1 = System.currentTimeMillis();
long l2 = 0L;
int i = 0;
if (!Painter.this.runDrawingThread)
return;
long l3 = System.currentTimeMillis();
if (i < 2)
{
Painter.this.onPaint(l3, true);
i++;
}
while (true)
{
while (true)
{
if ((l3 - l2) / 1000L >= 1L)
l2 = l3;
l1 += 16L;
long l4 = l1 - l3;
if (l4 < 0L)
break;
try
{
Thread.sleep(l4);
}
catch (Exception localException)
{
}
}
break;
Painter.this.onPaint(l3, false);
}
}
}).start();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货