410 lines
7.8 KiB
Smali
410 lines
7.8 KiB
Smali
.class public final Lf/d/a/b0/g;
|
|
.super Ljava/lang/Object;
|
|
.source "Utils.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Landroid/graphics/PathMeasure;
|
|
|
|
.field public static final b:Landroid/graphics/Path;
|
|
|
|
.field public static final c:Landroid/graphics/Path;
|
|
|
|
.field public static final d:[F
|
|
|
|
.field public static final e:F
|
|
|
|
.field public static f:F
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
new-instance v0, Landroid/graphics/PathMeasure;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/PathMeasure;-><init>()V
|
|
|
|
sput-object v0, Lf/d/a/b0/g;->a:Landroid/graphics/PathMeasure;
|
|
|
|
new-instance v0, Landroid/graphics/Path;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Path;-><init>()V
|
|
|
|
sput-object v0, Lf/d/a/b0/g;->b:Landroid/graphics/Path;
|
|
|
|
new-instance v0, Landroid/graphics/Path;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Path;-><init>()V
|
|
|
|
sput-object v0, Lf/d/a/b0/g;->c:Landroid/graphics/Path;
|
|
|
|
const/4 v0, 0x4
|
|
|
|
new-array v0, v0, [F
|
|
|
|
sput-object v0, Lf/d/a/b0/g;->d:[F
|
|
|
|
const-wide/high16 v0, 0x4000000000000000L # 2.0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D
|
|
|
|
move-result-wide v2
|
|
|
|
div-double/2addr v2, v0
|
|
|
|
double-to-float v0, v2
|
|
|
|
sput v0, Lf/d/a/b0/g;->e:F
|
|
|
|
const/high16 v0, -0x40800000 # -1.0f
|
|
|
|
sput v0, Lf/d/a/b0/g;->f:F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/graphics/Path;FFF)V
|
|
.locals 9
|
|
|
|
sget-object v0, Lf/d/a/b0/g;->a:Landroid/graphics/PathMeasure;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, p0, v1}, Landroid/graphics/PathMeasure;->setPath(Landroid/graphics/Path;Z)V
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/PathMeasure;->getLength()F
|
|
|
|
move-result v1
|
|
|
|
const/high16 v2, 0x3f800000 # 1.0f
|
|
|
|
const-string v3, "applyTrimPathIfNeeded"
|
|
|
|
const/4 v4, 0x0
|
|
|
|
cmpl-float v5, p1, v2
|
|
|
|
if-nez v5, :cond_0
|
|
|
|
cmpl-float v5, p2, v4
|
|
|
|
if-nez v5, :cond_0
|
|
|
|
invoke-static {v3}, Lf/d/a/c;->a(Ljava/lang/String;)F
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
cmpg-float v5, v1, v2
|
|
|
|
if-ltz v5, :cond_9
|
|
|
|
sub-float v5, p2, p1
|
|
|
|
sub-float/2addr v5, v2
|
|
|
|
invoke-static {v5}, Ljava/lang/Math;->abs(F)F
|
|
|
|
move-result v2
|
|
|
|
float-to-double v5, v2
|
|
|
|
const-wide v7, 0x3f847ae147ae147bL # 0.01
|
|
|
|
cmpg-double v2, v5, v7
|
|
|
|
if-gez v2, :cond_1
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_1
|
|
mul-float p1, p1, v1
|
|
|
|
mul-float p2, p2, v1
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Math;->min(FF)F
|
|
|
|
move-result v2
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Math;->max(FF)F
|
|
|
|
move-result p1
|
|
|
|
mul-float p3, p3, v1
|
|
|
|
add-float/2addr v2, p3
|
|
|
|
add-float/2addr p1, p3
|
|
|
|
cmpl-float p2, v2, v1
|
|
|
|
if-ltz p2, :cond_2
|
|
|
|
cmpl-float p2, p1, v1
|
|
|
|
if-ltz p2, :cond_2
|
|
|
|
invoke-static {v2, v1}, Lf/d/a/b0/f;->d(FF)I
|
|
|
|
move-result p2
|
|
|
|
int-to-float v2, p2
|
|
|
|
invoke-static {p1, v1}, Lf/d/a/b0/f;->d(FF)I
|
|
|
|
move-result p1
|
|
|
|
int-to-float p1, p1
|
|
|
|
:cond_2
|
|
cmpg-float p2, v2, v4
|
|
|
|
if-gez p2, :cond_3
|
|
|
|
invoke-static {v2, v1}, Lf/d/a/b0/f;->d(FF)I
|
|
|
|
move-result p2
|
|
|
|
int-to-float v2, p2
|
|
|
|
:cond_3
|
|
cmpg-float p2, p1, v4
|
|
|
|
if-gez p2, :cond_4
|
|
|
|
invoke-static {p1, v1}, Lf/d/a/b0/f;->d(FF)I
|
|
|
|
move-result p1
|
|
|
|
int-to-float p1, p1
|
|
|
|
:cond_4
|
|
cmpl-float p2, v2, p1
|
|
|
|
if-nez p2, :cond_5
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Path;->reset()V
|
|
|
|
invoke-static {v3}, Lf/d/a/c;->a(Ljava/lang/String;)F
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
if-ltz p2, :cond_6
|
|
|
|
sub-float/2addr v2, v1
|
|
|
|
:cond_6
|
|
sget-object p2, Lf/d/a/b0/g;->b:Landroid/graphics/Path;
|
|
|
|
invoke-virtual {p2}, Landroid/graphics/Path;->reset()V
|
|
|
|
const/4 p3, 0x1
|
|
|
|
invoke-virtual {v0, v2, p1, p2, p3}, Landroid/graphics/PathMeasure;->getSegment(FFLandroid/graphics/Path;Z)Z
|
|
|
|
cmpl-float v5, p1, v1
|
|
|
|
if-lez v5, :cond_7
|
|
|
|
sget-object v2, Lf/d/a/b0/g;->c:Landroid/graphics/Path;
|
|
|
|
invoke-virtual {v2}, Landroid/graphics/Path;->reset()V
|
|
|
|
rem-float/2addr p1, v1
|
|
|
|
invoke-virtual {v0, v4, p1, v2, p3}, Landroid/graphics/PathMeasure;->getSegment(FFLandroid/graphics/Path;Z)Z
|
|
|
|
invoke-virtual {p2, v2}, Landroid/graphics/Path;->addPath(Landroid/graphics/Path;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_7
|
|
cmpg-float p1, v2, v4
|
|
|
|
if-gez p1, :cond_8
|
|
|
|
sget-object p1, Lf/d/a/b0/g;->c:Landroid/graphics/Path;
|
|
|
|
invoke-virtual {p1}, Landroid/graphics/Path;->reset()V
|
|
|
|
add-float/2addr v2, v1
|
|
|
|
invoke-virtual {v0, v2, v1, p1, p3}, Landroid/graphics/PathMeasure;->getSegment(FFLandroid/graphics/Path;Z)Z
|
|
|
|
invoke-virtual {p2, p1}, Landroid/graphics/Path;->addPath(Landroid/graphics/Path;)V
|
|
|
|
:cond_8
|
|
:goto_0
|
|
invoke-virtual {p0, p2}, Landroid/graphics/Path;->set(Landroid/graphics/Path;)V
|
|
|
|
invoke-static {v3}, Lf/d/a/c;->a(Ljava/lang/String;)F
|
|
|
|
return-void
|
|
|
|
:cond_9
|
|
:goto_1
|
|
invoke-static {v3}, Lf/d/a/c;->a(Ljava/lang/String;)F
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static b(Ljava/io/Closeable;)V
|
|
.locals 0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
:try_start_0
|
|
invoke-interface {p0}, Ljava/io/Closeable;->close()V
|
|
:try_end_0
|
|
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
throw p0
|
|
|
|
:catch_1
|
|
:cond_0
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static c()F
|
|
.locals 2
|
|
|
|
sget v0, Lf/d/a/b0/g;->f:F
|
|
|
|
const/high16 v1, -0x40800000 # -1.0f
|
|
|
|
cmpl-float v0, v0, v1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object v0
|
|
|
|
iget v0, v0, Landroid/util/DisplayMetrics;->density:F
|
|
|
|
sput v0, Lf/d/a/b0/g;->f:F
|
|
|
|
:cond_0
|
|
sget v0, Lf/d/a/b0/g;->f:F
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public static d(Landroid/graphics/Matrix;)F
|
|
.locals 6
|
|
|
|
sget-object v0, Lf/d/a/b0/g;->d:[F
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput v2, v0, v1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
aput v2, v0, v3
|
|
|
|
sget v2, Lf/d/a/b0/g;->e:F
|
|
|
|
const/4 v4, 0x2
|
|
|
|
aput v2, v0, v4
|
|
|
|
const/4 v5, 0x3
|
|
|
|
aput v2, v0, v5
|
|
|
|
invoke-virtual {p0, v0}, Landroid/graphics/Matrix;->mapPoints([F)V
|
|
|
|
aget p0, v0, v4
|
|
|
|
aget v1, v0, v1
|
|
|
|
sub-float/2addr p0, v1
|
|
|
|
aget v1, v0, v5
|
|
|
|
aget v0, v0, v3
|
|
|
|
sub-float/2addr v1, v0
|
|
|
|
float-to-double v2, p0
|
|
|
|
float-to-double v0, v1
|
|
|
|
invoke-static {v2, v3, v0, v1}, Ljava/lang/Math;->hypot(DD)D
|
|
|
|
move-result-wide v0
|
|
|
|
double-to-float p0, v0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static e(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
if-ne v0, p1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I
|
|
|
|
move-result v0
|
|
|
|
if-ne v0, p2, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {p0, p1, p2, v0}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->recycle()V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static f(Landroid/graphics/Canvas;Landroid/graphics/RectF;Landroid/graphics/Paint;I)V
|
|
.locals 2
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x17
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Landroid/graphics/Canvas;->saveLayer(Landroid/graphics/RectF;Landroid/graphics/Paint;I)I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2}, Landroid/graphics/Canvas;->saveLayer(Landroid/graphics/RectF;Landroid/graphics/Paint;)I
|
|
|
|
:goto_0
|
|
const-string p0, "Utils#saveLayer"
|
|
|
|
invoke-static {p0}, Lf/d/a/c;->a(Ljava/lang/String;)F
|
|
|
|
return-void
|
|
.end method
|