mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
2501 lines
48 KiB
Smali
2501 lines
48 KiB
Smali
.class public final Lcom/google/common/net/InetAddresses;
|
|
.super Ljava/lang/Object;
|
|
.source "InetAddresses.java"
|
|
|
|
|
|
# annotations
|
|
.annotation runtime Lcom/google/common/net/ElementTypesAreNonnullByDefault;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/google/common/net/InetAddresses$TeredoInfo;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final ANY4:Ljava/net/Inet4Address;
|
|
|
|
.field private static final IPV4_DELIMITER:C = '.'
|
|
|
|
.field private static final IPV4_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
.field private static final IPV4_PART_COUNT:I = 0x4
|
|
|
|
.field private static final IPV6_DELIMITER:C = ':'
|
|
|
|
.field private static final IPV6_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
.field private static final IPV6_PART_COUNT:I = 0x8
|
|
|
|
.field private static final LOOPBACK4:Ljava/net/Inet4Address;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const/16 v0, 0x2e
|
|
|
|
.line 105
|
|
invoke-static {v0}, Lcom/google/common/base/CharMatcher;->is(C)Lcom/google/common/base/CharMatcher;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/google/common/net/InetAddresses;->IPV4_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
const/16 v0, 0x3a
|
|
|
|
.line 106
|
|
invoke-static {v0}, Lcom/google/common/base/CharMatcher;->is(C)Lcom/google/common/base/CharMatcher;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/google/common/net/InetAddresses;->IPV6_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
const-string v0, "127.0.0.1"
|
|
|
|
.line 107
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->forString(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/net/Inet4Address;
|
|
|
|
sput-object v0, Lcom/google/common/net/InetAddresses;->LOOPBACK4:Ljava/net/Inet4Address;
|
|
|
|
const-string v0, "0.0.0.0"
|
|
|
|
.line 108
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->forString(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/net/Inet4Address;
|
|
|
|
sput-object v0, Lcom/google/common/net/InetAddresses;->ANY4:Ljava/net/Inet4Address;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 110
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000()Ljava/net/Inet4Address;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/google/common/net/InetAddresses;->ANY4:Ljava/net/Inet4Address;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
.locals 1
|
|
|
|
.line 385
|
|
:try_start_0
|
|
invoke-static {p0}, Ljava/net/InetAddress;->getByAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 387
|
|
new-instance v0, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static coerceToInteger(Ljava/net/InetAddress;)I
|
|
.locals 0
|
|
|
|
.line 978
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getCoercedIPv4Address(Ljava/net/InetAddress;)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/net/Inet4Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/io/ByteStreams;->newDataInput([B)Lcom/google/common/io/ByteArrayDataInput;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0}, Lcom/google/common/io/ByteArrayDataInput;->readInt()I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method private static compressLongestRunOfZeroes([I)V
|
|
.locals 6
|
|
|
|
const/4 v0, -0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v0
|
|
|
|
move v3, v2
|
|
|
|
move v4, v3
|
|
|
|
.line 434
|
|
:goto_0
|
|
array-length v5, p0
|
|
|
|
add-int/lit8 v5, v5, 0x1
|
|
|
|
if-ge v1, v5, :cond_3
|
|
|
|
.line 435
|
|
array-length v5, p0
|
|
|
|
if-ge v1, v5, :cond_0
|
|
|
|
aget v5, p0, v1
|
|
|
|
if-nez v5, :cond_0
|
|
|
|
if-gez v4, :cond_2
|
|
|
|
move v4, v1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
if-ltz v4, :cond_2
|
|
|
|
sub-int v5, v1, v4
|
|
|
|
if-le v5, v2, :cond_1
|
|
|
|
move v3, v4
|
|
|
|
move v2, v5
|
|
|
|
:cond_1
|
|
move v4, v0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
const/4 v1, 0x2
|
|
|
|
if-lt v2, v1, :cond_4
|
|
|
|
add-int/2addr v2, v3
|
|
|
|
.line 449
|
|
invoke-static {p0, v3, v2, v0}, Ljava/util/Arrays;->fill([IIII)V
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method private static convertDottedQuadToHex(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 5
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
|
|
const/16 v0, 0x3a
|
|
|
|
.line 319
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->lastIndexOf(I)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
.line 320
|
|
invoke-virtual {p0, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
.line 321
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 322
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->textToNumericFormatV4(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
.line 326
|
|
:cond_0
|
|
aget-byte v0, p0, v2
|
|
|
|
and-int/lit16 v0, v0, 0xff
|
|
|
|
shl-int/lit8 v0, v0, 0x8
|
|
|
|
aget-byte v2, p0, v1
|
|
|
|
and-int/lit16 v2, v2, 0xff
|
|
|
|
or-int/2addr v0, v2
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v2, 0x2
|
|
|
|
.line 327
|
|
aget-byte v2, p0, v2
|
|
|
|
and-int/lit16 v2, v2, 0xff
|
|
|
|
shl-int/lit8 v2, v2, 0x8
|
|
|
|
const/4 v4, 0x3
|
|
|
|
aget-byte p0, p0, v4
|
|
|
|
and-int/lit16 p0, p0, 0xff
|
|
|
|
or-int/2addr p0, v2
|
|
|
|
invoke-static {p0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 328
|
|
invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v2, v1
|
|
|
|
invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v2, v1
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v1
|
|
|
|
add-int/2addr v2, v1
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, ":"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static decrement(Ljava/net/InetAddress;)Ljava/net/InetAddress;
|
|
.locals 5
|
|
|
|
.line 1097
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object v0
|
|
|
|
.line 1098
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
:goto_0
|
|
if-ltz v1, :cond_0
|
|
|
|
.line 1099
|
|
aget-byte v3, v0, v1
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
const/4 v3, -0x1
|
|
|
|
.line 1100
|
|
aput-byte v3, v0, v1
|
|
|
|
add-int/lit8 v1, v1, -0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
if-ltz v1, :cond_1
|
|
|
|
move v3, v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
const-string v4, "Decrementing %s would wrap."
|
|
|
|
.line 1104
|
|
invoke-static {v3, v4, p0}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 1106
|
|
aget-byte p0, v0, v1
|
|
|
|
sub-int/2addr p0, v2
|
|
|
|
int-to-byte p0, p0
|
|
|
|
aput-byte p0, v0, v1
|
|
|
|
.line 1107
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static forString(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
.locals 1
|
|
|
|
.line 148
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->ipStringToBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 155
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string v0, "\'%s\' is not an IP string literal."
|
|
|
|
.line 152
|
|
filled-new-array {p0}, [Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v0, p0}, Lcom/google/common/net/InetAddresses;->formatIllegalArgumentException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object p0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static forUriString(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
.locals 1
|
|
|
|
.line 531
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->forUriStringNoThrow(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
const-string v0, "Not a valid URI IP literal: \'%s\'"
|
|
|
|
.line 533
|
|
filled-new-array {p0}, [Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v0, p0}, Lcom/google/common/net/InetAddresses;->formatIllegalArgumentException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object p0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static forUriStringNoThrow(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
.locals 2
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
|
|
.line 541
|
|
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const-string v0, "["
|
|
|
|
.line 546
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v0, "]"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 547
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0, v1, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0x10
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x4
|
|
|
|
.line 555
|
|
:goto_0
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->ipStringToBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 556
|
|
array-length v1, p0
|
|
|
|
if-eq v1, v0, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 560
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static varargs formatIllegalArgumentException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
.locals 2
|
|
|
|
.line 1153
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
sget-object v1, Ljava/util/Locale;->ROOT:Ljava/util/Locale;
|
|
|
|
invoke-static {v1, p0, p1}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static fromBigInteger(Ljava/math/BigInteger;Z)Ljava/net/InetAddress;
|
|
.locals 7
|
|
|
|
.line 1038
|
|
invoke-virtual {p0}, Ljava/math/BigInteger;->signum()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move v0, v1
|
|
|
|
:goto_0
|
|
const-string v2, "BigInteger must be greater than or equal to 0"
|
|
|
|
invoke-static {v0, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/Object;)V
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
const/16 p1, 0x10
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 p1, 0x4
|
|
|
|
.line 1042
|
|
:goto_1
|
|
invoke-virtual {p0}, Ljava/math/BigInteger;->toByteArray()[B
|
|
|
|
move-result-object v0
|
|
|
|
.line 1043
|
|
new-array v2, p1, [B
|
|
|
|
.line 1045
|
|
array-length v3, v0
|
|
|
|
sub-int/2addr v3, p1
|
|
|
|
invoke-static {v1, v3}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result v3
|
|
|
|
.line 1046
|
|
array-length v4, v0
|
|
|
|
sub-int/2addr v4, v3
|
|
|
|
sub-int v5, p1, v4
|
|
|
|
:goto_2
|
|
if-ge v1, v3, :cond_3
|
|
|
|
.line 1051
|
|
aget-byte v6, v0, v1
|
|
|
|
if-nez v6, :cond_2
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
.line 1055
|
|
:cond_2
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
filled-new-array {p1, p0}, [Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "BigInteger cannot be converted to InetAddress because it has more than %d bytes: %s"
|
|
|
|
.line 1052
|
|
invoke-static {p1, p0}, Lcom/google/common/net/InetAddresses;->formatIllegalArgumentException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object p0
|
|
|
|
throw p0
|
|
|
|
.line 1060
|
|
:cond_3
|
|
invoke-static {v0, v3, v2, v5, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
|
|
|
|
.line 1063
|
|
:try_start_0
|
|
invoke-static {v2}, Ljava/net/InetAddress;->getByAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 1065
|
|
new-instance p1, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {p1, p0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public static fromIPv4BigInteger(Ljava/math/BigInteger;)Ljava/net/Inet4Address;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 1013
|
|
invoke-static {p0, v0}, Lcom/google/common/net/InetAddresses;->fromBigInteger(Ljava/math/BigInteger;Z)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/net/Inet4Address;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static fromIPv6BigInteger(Ljava/math/BigInteger;)Ljava/net/Inet6Address;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 1024
|
|
invoke-static {p0, v0}, Lcom/google/common/net/InetAddresses;->fromBigInteger(Ljava/math/BigInteger;Z)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/net/Inet6Address;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static fromInteger(I)Ljava/net/Inet4Address;
|
|
.locals 0
|
|
|
|
.line 1001
|
|
invoke-static {p0}, Lcom/google/common/primitives/Ints;->toByteArray(I)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static fromLittleEndianByteArray([B)Ljava/net/InetAddress;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/net/UnknownHostException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 1080
|
|
array-length v0, p0
|
|
|
|
new-array v0, v0, [B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 1081
|
|
:goto_0
|
|
array-length v2, p0
|
|
|
|
if-ge v1, v2, :cond_0
|
|
|
|
.line 1082
|
|
array-length v2, p0
|
|
|
|
sub-int/2addr v2, v1
|
|
|
|
add-int/lit8 v2, v2, -0x1
|
|
|
|
aget-byte v2, p0, v2
|
|
|
|
aput-byte v2, v0, v1
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 1084
|
|
:cond_0
|
|
invoke-static {v0}, Ljava/net/InetAddress;->getByAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static get6to4IPv4Address(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
.locals 3
|
|
|
|
.line 652
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->is6to4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "Address \'%s\' is not a 6to4 address."
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v0, v1, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 654
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const/4 v1, 0x6
|
|
|
|
invoke-static {p0, v0, v1}, Ljava/util/Arrays;->copyOfRange([BII)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getCoercedIPv4Address(Ljava/net/InetAddress;)Ljava/net/Inet4Address;
|
|
.locals 6
|
|
|
|
.line 916
|
|
instance-of v0, p0, Ljava/net/Inet4Address;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 917
|
|
check-cast p0, Ljava/net/Inet4Address;
|
|
|
|
return-object p0
|
|
|
|
.line 921
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
:goto_0
|
|
const/16 v3, 0xf
|
|
|
|
const/4 v4, 0x1
|
|
|
|
if-ge v2, v3, :cond_2
|
|
|
|
.line 924
|
|
aget-byte v5, v0, v2
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
move v2, v1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
move v2, v4
|
|
|
|
:goto_1
|
|
if-eqz v2, :cond_3
|
|
|
|
.line 929
|
|
aget-byte v5, v0, v3
|
|
|
|
if-ne v5, v4, :cond_3
|
|
|
|
sget-object p0, Lcom/google/common/net/InetAddresses;->LOOPBACK4:Ljava/net/Inet4Address;
|
|
|
|
return-object p0
|
|
|
|
:cond_3
|
|
if-eqz v2, :cond_4
|
|
|
|
.line 931
|
|
aget-byte v0, v0, v3
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
sget-object p0, Lcom/google/common/net/InetAddresses;->ANY4:Ljava/net/Inet4Address;
|
|
|
|
return-object p0
|
|
|
|
.line 935
|
|
:cond_4
|
|
check-cast p0, Ljava/net/Inet6Address;
|
|
|
|
.line 937
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->hasEmbeddedIPv4ClientAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
.line 938
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getEmbeddedIPv4ClientAddress(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/net/Inet4Address;->hashCode()I
|
|
|
|
move-result p0
|
|
|
|
int-to-long v0, p0
|
|
|
|
goto :goto_2
|
|
|
|
.line 941
|
|
:cond_5
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0x8
|
|
|
|
invoke-static {p0, v1, v0}, Ljava/nio/ByteBuffer;->wrap([BII)Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/nio/ByteBuffer;->getLong()J
|
|
|
|
move-result-wide v0
|
|
|
|
.line 945
|
|
:goto_2
|
|
invoke-static {}, Lcom/google/common/hash/Hashing;->murmur3_32_fixed()Lcom/google/common/hash/HashFunction;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-interface {p0, v0, v1}, Lcom/google/common/hash/HashFunction;->hashLong(J)Lcom/google/common/hash/HashCode;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Lcom/google/common/hash/HashCode;->asInt()I
|
|
|
|
move-result p0
|
|
|
|
const/high16 v0, -0x20000000
|
|
|
|
or-int/2addr p0, v0
|
|
|
|
const/4 v0, -0x1
|
|
|
|
if-ne p0, v0, :cond_6
|
|
|
|
const/4 p0, -0x2
|
|
|
|
.line 956
|
|
:cond_6
|
|
invoke-static {p0}, Lcom/google/common/primitives/Ints;->toByteArray(I)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getCompatIPv4Address(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
.locals 3
|
|
|
|
.line 622
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isCompatIPv4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "Address \'%s\' is not IPv4-compatible."
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
.line 621
|
|
invoke-static {v0, v1, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 624
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0xc
|
|
|
|
const/16 v1, 0x10
|
|
|
|
invoke-static {p0, v0, v1}, Ljava/util/Arrays;->copyOfRange([BII)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getEmbeddedIPv4ClientAddress(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
.locals 1
|
|
|
|
.line 837
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isCompatIPv4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 838
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getCompatIPv4Address(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 841
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->is6to4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 842
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->get6to4IPv4Address(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 845
|
|
:cond_1
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isTeredoAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 846
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getTeredoInfo(Ljava/net/Inet6Address;)Lcom/google/common/net/InetAddresses$TeredoInfo;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Lcom/google/common/net/InetAddresses$TeredoInfo;->getClient()Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 849
|
|
:cond_2
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
filled-new-array {p0}, [Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "\'%s\' has no embedded IPv4 address."
|
|
|
|
invoke-static {v0, p0}, Lcom/google/common/net/InetAddresses;->formatIllegalArgumentException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object p0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static getInet4Address([B)Ljava/net/Inet4Address;
|
|
.locals 3
|
|
|
|
.line 120
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
const-string v1, "Byte array has invalid length for an IPv4 address: %s != 4."
|
|
|
|
array-length v2, p0
|
|
|
|
invoke-static {v0, v1, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;I)V
|
|
|
|
.line 126
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/net/Inet4Address;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getIsatapIPv4Address(Ljava/net/Inet6Address;)Ljava/net/Inet4Address;
|
|
.locals 3
|
|
|
|
.line 803
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isIsatapAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "Address \'%s\' is not an ISATAP address."
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v0, v1, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 805
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0xc
|
|
|
|
const/16 v1, 0x10
|
|
|
|
invoke-static {p0, v0, v1}, Ljava/util/Arrays;->copyOfRange([BII)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getTeredoInfo(Ljava/net/Inet6Address;)Lcom/google/common/net/InetAddresses$TeredoInfo;
|
|
.locals 5
|
|
|
|
.line 742
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isTeredoAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "Address \'%s\' is not a Teredo address."
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v0, v1, v2}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 744
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x4
|
|
|
|
const/16 v1, 0x8
|
|
|
|
.line 745
|
|
invoke-static {p0, v0, v1}, Ljava/util/Arrays;->copyOfRange([BII)[B
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object v0
|
|
|
|
.line 747
|
|
invoke-static {p0, v1}, Lcom/google/common/io/ByteStreams;->newDataInput([BI)Lcom/google/common/io/ByteArrayDataInput;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Lcom/google/common/io/ByteArrayDataInput;->readShort()S
|
|
|
|
move-result v1
|
|
|
|
const v2, 0xffff
|
|
|
|
and-int/2addr v1, v2
|
|
|
|
const/16 v3, 0xa
|
|
|
|
.line 750
|
|
invoke-static {p0, v3}, Lcom/google/common/io/ByteStreams;->newDataInput([BI)Lcom/google/common/io/ByteArrayDataInput;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Lcom/google/common/io/ByteArrayDataInput;->readShort()S
|
|
|
|
move-result v3
|
|
|
|
not-int v3, v3
|
|
|
|
and-int/2addr v2, v3
|
|
|
|
const/16 v3, 0xc
|
|
|
|
const/16 v4, 0x10
|
|
|
|
.line 752
|
|
invoke-static {p0, v3, v4}, Ljava/util/Arrays;->copyOfRange([BII)[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.line 753
|
|
:goto_0
|
|
array-length v4, p0
|
|
|
|
if-ge v3, v4, :cond_0
|
|
|
|
.line 755
|
|
aget-byte v4, p0, v3
|
|
|
|
not-int v4, v4
|
|
|
|
int-to-byte v4, v4
|
|
|
|
aput-byte v4, p0, v3
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 757
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->getInet4Address([B)Ljava/net/Inet4Address;
|
|
|
|
move-result-object p0
|
|
|
|
.line 759
|
|
new-instance v3, Lcom/google/common/net/InetAddresses$TeredoInfo;
|
|
|
|
invoke-direct {v3, v0, p0, v2, v1}, Lcom/google/common/net/InetAddresses$TeredoInfo;-><init>(Ljava/net/Inet4Address;Ljava/net/Inet4Address;II)V
|
|
|
|
return-object v3
|
|
.end method
|
|
|
|
.method public static hasEmbeddedIPv4ClientAddress(Ljava/net/Inet6Address;)Z
|
|
.locals 1
|
|
|
|
.line 821
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isCompatIPv4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->is6to4Address(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isTeredoAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p0, 0x1
|
|
|
|
:goto_1
|
|
return p0
|
|
.end method
|
|
|
|
.method private static hextetsToIPv6String([I)Ljava/lang/String;
|
|
.locals 5
|
|
|
|
.line 466
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const/16 v1, 0x27
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
move v3, v2
|
|
|
|
.line 468
|
|
:goto_0
|
|
array-length v4, p0
|
|
|
|
if-ge v2, v4, :cond_5
|
|
|
|
.line 469
|
|
aget v4, p0, v2
|
|
|
|
if-ltz v4, :cond_0
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
move v4, v1
|
|
|
|
:goto_1
|
|
if-eqz v4, :cond_2
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
const/16 v3, 0x3a
|
|
|
|
.line 472
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
|
|
|
|
.line 474
|
|
:cond_1
|
|
aget v3, p0, v2
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
if-eqz v2, :cond_3
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
:cond_3
|
|
const-string v3, "::"
|
|
|
|
.line 477
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
:cond_4
|
|
:goto_2
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
move v3, v4
|
|
|
|
goto :goto_0
|
|
|
|
.line 482
|
|
:cond_5
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static increment(Ljava/net/InetAddress;)Ljava/net/InetAddress;
|
|
.locals 6
|
|
|
|
.line 1120
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object v0
|
|
|
|
.line 1121
|
|
array-length v1, v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
:goto_0
|
|
const/4 v3, 0x0
|
|
|
|
if-ltz v1, :cond_0
|
|
|
|
.line 1122
|
|
aget-byte v4, v0, v1
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-ne v4, v5, :cond_0
|
|
|
|
.line 1123
|
|
aput-byte v3, v0, v1
|
|
|
|
add-int/lit8 v1, v1, -0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
if-ltz v1, :cond_1
|
|
|
|
move v3, v2
|
|
|
|
:cond_1
|
|
const-string v4, "Incrementing %s would wrap."
|
|
|
|
.line 1127
|
|
invoke-static {v3, v4, p0}, Lcom/google/common/base/Preconditions;->checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
|
|
|
|
.line 1129
|
|
aget-byte p0, v0, v1
|
|
|
|
add-int/2addr p0, v2
|
|
|
|
int-to-byte p0, p0
|
|
|
|
aput-byte p0, v0, v1
|
|
|
|
.line 1130
|
|
invoke-static {v0}, Lcom/google/common/net/InetAddresses;->bytesToInetAddress([B)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private static ipStringToBytes(Ljava/lang/String;)[B
|
|
.locals 9
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
move v1, v0
|
|
|
|
move v2, v1
|
|
|
|
move v3, v2
|
|
|
|
.line 182
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, -0x1
|
|
|
|
if-ge v1, v4, :cond_5
|
|
|
|
.line 183
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v4
|
|
|
|
const/16 v7, 0x2e
|
|
|
|
const/4 v8, 0x1
|
|
|
|
if-ne v4, v7, :cond_0
|
|
|
|
move v2, v8
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
const/16 v7, 0x3a
|
|
|
|
if-ne v4, v7, :cond_2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
return-object v5
|
|
|
|
:cond_1
|
|
move v3, v8
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/16 v7, 0x25
|
|
|
|
if-ne v4, v7, :cond_3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/16 v7, 0x10
|
|
|
|
.line 194
|
|
invoke-static {v4, v7}, Ljava/lang/Character;->digit(CI)I
|
|
|
|
move-result v4
|
|
|
|
if-ne v4, v6, :cond_4
|
|
|
|
return-object v5
|
|
|
|
:cond_4
|
|
:goto_1
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_5
|
|
move v1, v6
|
|
|
|
:goto_2
|
|
if-eqz v3, :cond_8
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
.line 202
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->convertDottedQuadToHex(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_6
|
|
|
|
return-object v5
|
|
|
|
:cond_6
|
|
if-eq v1, v6, :cond_7
|
|
|
|
.line 208
|
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 210
|
|
:cond_7
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->textToNumericFormatV6(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_8
|
|
if-eqz v2, :cond_a
|
|
|
|
if-eq v1, v6, :cond_9
|
|
|
|
return-object v5
|
|
|
|
.line 215
|
|
:cond_9
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->textToNumericFormatV4(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_a
|
|
return-object v5
|
|
.end method
|
|
|
|
.method public static is6to4Address(Ljava/net/Inet6Address;)Z
|
|
.locals 3
|
|
|
|
.line 640
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 641
|
|
aget-byte v1, p0, v0
|
|
|
|
const/16 v2, 0x20
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aget-byte p0, p0, v1
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-ne p0, v2, :cond_0
|
|
|
|
move v0, v1
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isCompatIPv4Address(Ljava/net/Inet6Address;)Z
|
|
.locals 3
|
|
|
|
.line 598
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->isIPv4CompatibleAddress()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 602
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0xc
|
|
|
|
.line 603
|
|
aget-byte v0, p0, v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/16 v0, 0xd
|
|
|
|
aget-byte v0, p0, v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/16 v0, 0xe
|
|
|
|
aget-byte v0, p0, v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/16 v0, 0xf
|
|
|
|
aget-byte p0, p0, v0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
if-ne p0, v2, :cond_2
|
|
|
|
:cond_1
|
|
return v1
|
|
|
|
:cond_2
|
|
return v2
|
|
.end method
|
|
|
|
.method public static isInetAddress(Ljava/lang/String;)Z
|
|
.locals 0
|
|
|
|
.line 171
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->ipStringToBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isIsatapAddress(Ljava/net/Inet6Address;)Z
|
|
.locals 3
|
|
|
|
.line 779
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->isTeredoAddress(Ljava/net/Inet6Address;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return v1
|
|
|
|
.line 783
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0x8
|
|
|
|
.line 785
|
|
aget-byte v0, p0, v0
|
|
|
|
const/4 v2, 0x3
|
|
|
|
or-int/2addr v0, v2
|
|
|
|
if-eq v0, v2, :cond_1
|
|
|
|
return v1
|
|
|
|
:cond_1
|
|
const/16 v0, 0x9
|
|
|
|
.line 792
|
|
aget-byte v0, p0, v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/16 v0, 0xa
|
|
|
|
aget-byte v0, p0, v0
|
|
|
|
const/16 v2, 0x5e
|
|
|
|
if-ne v0, v2, :cond_2
|
|
|
|
const/16 v0, 0xb
|
|
|
|
aget-byte p0, p0, v0
|
|
|
|
const/4 v0, -0x2
|
|
|
|
if-ne p0, v0, :cond_2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_2
|
|
return v1
|
|
.end method
|
|
|
|
.method public static isMappedIPv4Address(Ljava/lang/String;)Z
|
|
.locals 4
|
|
|
|
.line 875
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->ipStringToBytes(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p0, :cond_4
|
|
|
|
.line 876
|
|
array-length v1, p0
|
|
|
|
const/16 v2, 0x10
|
|
|
|
if-ne v1, v2, :cond_4
|
|
|
|
move v1, v0
|
|
|
|
:goto_0
|
|
const/16 v2, 0xa
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
.line 878
|
|
aget-byte v2, p0, v1
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
return v0
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
const/16 v1, 0xc
|
|
|
|
if-ge v2, v1, :cond_3
|
|
|
|
.line 883
|
|
aget-byte v1, p0, v2
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-eq v1, v3, :cond_2
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_4
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isMaximum(Ljava/net/InetAddress;)Z
|
|
.locals 5
|
|
|
|
.line 1142
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
.line 1143
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
move v2, v1
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
aget-byte v3, p0, v2
|
|
|
|
const/4 v4, -0x1
|
|
|
|
if-eq v3, v4, :cond_0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isTeredoAddress(Ljava/net/Inet6Address;)Z
|
|
.locals 3
|
|
|
|
.line 727
|
|
invoke-virtual {p0}, Ljava/net/Inet6Address;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 728
|
|
aget-byte v1, p0, v0
|
|
|
|
const/16 v2, 0x20
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
aget-byte v2, p0, v1
|
|
|
|
if-ne v2, v1, :cond_0
|
|
|
|
const/4 v2, 0x2
|
|
|
|
aget-byte v2, p0, v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
const/4 v2, 0x3
|
|
|
|
aget-byte p0, p0, v2
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
move v0, v1
|
|
|
|
:cond_0
|
|
return v0
|
|
.end method
|
|
|
|
.method public static isUriInetAddress(Ljava/lang/String;)Z
|
|
.locals 0
|
|
|
|
.line 576
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->forUriStringNoThrow(Ljava/lang/String;)Ljava/net/InetAddress;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
:goto_0
|
|
return p0
|
|
.end method
|
|
|
|
.method private static parseHextet(Ljava/lang/String;II)S
|
|
.locals 3
|
|
|
|
sub-int v0, p2, p1
|
|
|
|
if-lez v0, :cond_1
|
|
|
|
const/4 v1, 0x4
|
|
|
|
if-gt v0, v1, :cond_1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-ge p1, p2, :cond_0
|
|
|
|
shl-int/lit8 v0, v0, 0x4
|
|
|
|
.line 368
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x10
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Character;->digit(CI)I
|
|
|
|
move-result v1
|
|
|
|
or-int/2addr v0, v1
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
int-to-short p0, v0
|
|
|
|
return p0
|
|
|
|
.line 363
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static parseOctet(Ljava/lang/String;II)B
|
|
.locals 3
|
|
|
|
sub-int v0, p2, p1
|
|
|
|
if-lez v0, :cond_5
|
|
|
|
const/4 v1, 0x3
|
|
|
|
if-gt v0, v1, :cond_5
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-le v0, v1, :cond_1
|
|
|
|
.line 340
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v0
|
|
|
|
const/16 v1, 0x30
|
|
|
|
if-eq v0, v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 341
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_1
|
|
if-ge p1, p2, :cond_3
|
|
|
|
mul-int/lit8 v0, v0, 0xa
|
|
|
|
.line 346
|
|
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0xa
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Character;->digit(CI)I
|
|
|
|
move-result v1
|
|
|
|
if-ltz v1, :cond_2
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.line 348
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
|
|
:cond_3
|
|
const/16 p0, 0xff
|
|
|
|
if-gt v0, p0, :cond_4
|
|
|
|
int-to-byte p0, v0
|
|
|
|
return p0
|
|
|
|
.line 353
|
|
:cond_4
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
|
|
.line 336
|
|
:cond_5
|
|
new-instance p0, Ljava/lang/NumberFormatException;
|
|
|
|
invoke-direct {p0}, Ljava/lang/NumberFormatException;-><init>()V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method private static textToNumericFormatV4(Ljava/lang/String;)[B
|
|
.locals 7
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/google/common/net/InetAddresses;->IPV4_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
.line 222
|
|
invoke-virtual {v0, p0}, Lcom/google/common/base/CharMatcher;->countIn(Ljava/lang/CharSequence;)I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x4
|
|
|
|
if-eq v0, v2, :cond_0
|
|
|
|
return-object v1
|
|
|
|
:cond_0
|
|
new-array v0, v2, [B
|
|
|
|
const/4 v3, 0x0
|
|
|
|
move v4, v3
|
|
|
|
:goto_0
|
|
if-ge v3, v2, :cond_2
|
|
|
|
const/16 v5, 0x2e
|
|
|
|
.line 231
|
|
invoke-virtual {p0, v5, v4}, Ljava/lang/String;->indexOf(II)I
|
|
|
|
move-result v5
|
|
|
|
const/4 v6, -0x1
|
|
|
|
if-ne v5, v6, :cond_1
|
|
|
|
.line 233
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v5
|
|
|
|
.line 236
|
|
:cond_1
|
|
:try_start_0
|
|
invoke-static {p0, v4, v5}, Lcom/google/common/net/InetAddresses;->parseOctet(Ljava/lang/String;II)B
|
|
|
|
move-result v4
|
|
|
|
aput-byte v4, v0, v3
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
add-int/lit8 v4, v5, 0x1
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
return-object v1
|
|
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private static textToNumericFormatV6(Ljava/lang/String;)[B
|
|
.locals 11
|
|
.annotation runtime Ljavax/annotation/CheckForNull;
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/google/common/net/InetAddresses;->IPV6_DELIMITER_MATCHER:Lcom/google/common/base/CharMatcher;
|
|
|
|
.line 249
|
|
invoke-virtual {v0, p0}, Lcom/google/common/base/CharMatcher;->countIn(Ljava/lang/CharSequence;)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-lt v0, v2, :cond_f
|
|
|
|
const/16 v3, 0x8
|
|
|
|
if-le v0, v3, :cond_0
|
|
|
|
goto/16 :goto_3
|
|
|
|
:cond_0
|
|
const/4 v4, 0x1
|
|
|
|
add-int/2addr v0, v4
|
|
|
|
rsub-int/lit8 v5, v0, 0x8
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move v7, v6
|
|
|
|
move v8, v7
|
|
|
|
.line 257
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v9
|
|
|
|
sub-int/2addr v9, v4
|
|
|
|
const/16 v10, 0x3a
|
|
|
|
if-ge v7, v9, :cond_5
|
|
|
|
.line 258
|
|
invoke-virtual {p0, v7}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v9
|
|
|
|
if-ne v9, v10, :cond_4
|
|
|
|
add-int/lit8 v9, v7, 0x1
|
|
|
|
invoke-virtual {p0, v9}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v9
|
|
|
|
if-ne v9, v10, :cond_4
|
|
|
|
if-eqz v8, :cond_1
|
|
|
|
return-object v1
|
|
|
|
:cond_1
|
|
add-int/lit8 v8, v5, 0x1
|
|
|
|
if-nez v7, :cond_2
|
|
|
|
add-int/lit8 v8, v5, 0x2
|
|
|
|
.line 267
|
|
:cond_2
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v5
|
|
|
|
sub-int/2addr v5, v2
|
|
|
|
if-ne v7, v5, :cond_3
|
|
|
|
add-int/lit8 v8, v8, 0x1
|
|
|
|
:cond_3
|
|
move v5, v8
|
|
|
|
move v8, v4
|
|
|
|
:cond_4
|
|
add-int/lit8 v7, v7, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 272
|
|
:cond_5
|
|
invoke-virtual {p0, v6}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v7
|
|
|
|
if-ne v7, v10, :cond_6
|
|
|
|
invoke-virtual {p0, v4}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v7
|
|
|
|
if-eq v7, v10, :cond_6
|
|
|
|
return-object v1
|
|
|
|
.line 275
|
|
:cond_6
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v7
|
|
|
|
sub-int/2addr v7, v4
|
|
|
|
invoke-virtual {p0, v7}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v7
|
|
|
|
if-ne v7, v10, :cond_7
|
|
|
|
.line 276
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v7
|
|
|
|
sub-int/2addr v7, v2
|
|
|
|
invoke-virtual {p0, v7}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
if-eq v2, v10, :cond_7
|
|
|
|
return-object v1
|
|
|
|
:cond_7
|
|
if-eqz v8, :cond_8
|
|
|
|
if-gtz v5, :cond_8
|
|
|
|
return-object v1
|
|
|
|
:cond_8
|
|
if-nez v8, :cond_9
|
|
|
|
if-eq v0, v3, :cond_9
|
|
|
|
return-object v1
|
|
|
|
:cond_9
|
|
const/16 v0, 0x10
|
|
|
|
.line 286
|
|
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocate(I)Ljava/nio/ByteBuffer;
|
|
|
|
move-result-object v0
|
|
|
|
.line 292
|
|
:try_start_0
|
|
invoke-virtual {p0, v6}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v2
|
|
|
|
if-ne v2, v10, :cond_a
|
|
|
|
goto :goto_1
|
|
|
|
:cond_a
|
|
move v4, v6
|
|
|
|
.line 295
|
|
:goto_1
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
if-ge v4, v2, :cond_e
|
|
|
|
.line 296
|
|
invoke-virtual {p0, v10, v4}, Ljava/lang/String;->indexOf(II)I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-ne v2, v3, :cond_b
|
|
|
|
.line 298
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
.line 300
|
|
:cond_b
|
|
invoke-virtual {p0, v4}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v3
|
|
|
|
if-ne v3, v10, :cond_c
|
|
|
|
move v3, v6
|
|
|
|
:goto_2
|
|
if-ge v3, v5, :cond_d
|
|
|
|
.line 303
|
|
invoke-virtual {v0, v6}, Ljava/nio/ByteBuffer;->putShort(S)Ljava/nio/ByteBuffer;
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
.line 307
|
|
:cond_c
|
|
invoke-static {p0, v4, v2}, Lcom/google/common/net/InetAddresses;->parseHextet(Ljava/lang/String;II)S
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->putShort(S)Ljava/nio/ByteBuffer;
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:cond_d
|
|
add-int/lit8 v4, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
.line 314
|
|
:cond_e
|
|
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->array()[B
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
:cond_f
|
|
:goto_3
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public static toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
.locals 6
|
|
|
|
.line 407
|
|
invoke-static {p0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 408
|
|
instance-of v0, p0, Ljava/net/Inet4Address;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 410
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getHostAddress()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 412
|
|
:cond_0
|
|
instance-of v0, p0, Ljava/net/Inet6Address;
|
|
|
|
invoke-static {v0}, Lcom/google/common/base/Preconditions;->checkArgument(Z)V
|
|
|
|
.line 413
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0x8
|
|
|
|
new-array v1, v0, [I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
move v3, v2
|
|
|
|
:goto_0
|
|
if-ge v3, v0, :cond_1
|
|
|
|
mul-int/lit8 v4, v3, 0x2
|
|
|
|
.line 416
|
|
aget-byte v5, p0, v4
|
|
|
|
add-int/lit8 v4, v4, 0x1
|
|
|
|
aget-byte v4, p0, v4
|
|
|
|
invoke-static {v2, v2, v5, v4}, Lcom/google/common/primitives/Ints;->fromBytes(BBBB)I
|
|
|
|
move-result v4
|
|
|
|
aput v4, v1, v3
|
|
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.line 418
|
|
:cond_1
|
|
invoke-static {v1}, Lcom/google/common/net/InetAddresses;->compressLongestRunOfZeroes([I)V
|
|
|
|
.line 419
|
|
invoke-static {v1}, Lcom/google/common/net/InetAddresses;->hextetsToIPv6String([I)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static toBigInteger(Ljava/net/InetAddress;)Ljava/math/BigInteger;
|
|
.locals 2
|
|
|
|
.line 991
|
|
new-instance v0, Ljava/math/BigInteger;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p0}, Ljava/net/InetAddress;->getAddress()[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-direct {v0, v1, p0}, Ljava/math/BigInteger;-><init>(I[B)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static toUriString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
.line 505
|
|
instance-of v0, p0, Ljava/net/Inet6Address;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 506
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
add-int/lit8 v0, v0, 0x2
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(I)V
|
|
|
|
const-string v0, "["
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "]"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 508
|
|
:cond_0
|
|
invoke-static {p0}, Lcom/google/common/net/InetAddresses;->toAddrString(Ljava/net/InetAddress;)Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|