549 lines
13 KiB
Smali
549 lines
13 KiB
Smali
.class public final Ln0/d;
|
|
.super Ljava/lang/Object;
|
|
.source "CarPendingIntent.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final a:Ljava/lang/String; = "androidx.car.app.activity.CarAppActivity"
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final b:Ljava/lang/String; = "androidx.car.app.notification.COMPONENT_EXTRA_KEY"
|
|
|
|
.field public static final c:Ljava/lang/String; = "geo:"
|
|
|
|
.field public static final d:Ljava/lang/String; = "tel:"
|
|
|
|
.field public static final e:Ljava/lang/String; = "q"
|
|
|
|
.field public static final f:Ljava/lang/String; = "q="
|
|
|
|
.field public static final g:I = 0x2000000
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
.line 3
|
|
invoke-virtual {v1}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
const-string v1, "androidx.car.app.activity.CarAppActivity"
|
|
|
|
.line 4
|
|
invoke-virtual {p2, v0, v1}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
.line 5
|
|
:cond_0
|
|
invoke-static {p0, p1, p2, p3}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static b(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "androidx.car.app.notification.COMPONENT_EXTRA_KEY"
|
|
|
|
invoke-virtual {p2, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
|
|
|
|
.line 2
|
|
const-class v0, Landroidx/car/app/notification/CarAppNotificationBroadcastReceiver;
|
|
|
|
invoke-virtual {p2, p0, v0}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
|
|
|
|
.line 3
|
|
invoke-static {p0, p1, p2, p3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static c(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
.locals 1
|
|
.param p0 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/content/Intent;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-static {p0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 2
|
|
invoke-static {p2}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 3
|
|
invoke-static {p0, p2}, Ln0/d;->f(Landroid/content/Context;Landroid/content/Intent;)V
|
|
|
|
const v0, -0x4000001
|
|
|
|
and-int/2addr p3, v0
|
|
|
|
const/high16 v0, 0x2000000
|
|
|
|
or-int/2addr p3, v0
|
|
|
|
.line 4
|
|
invoke-static {p0}, Landroidx/car/app/utils/b;->a(Landroid/content/Context;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 5
|
|
invoke-static {p0, p1, p2, p3}, Ln0/d;->a(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
.line 6
|
|
:cond_0
|
|
invoke-static {p0, p1, p2, p3}, Ln0/d;->b(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static d(Landroid/net/Uri;)Ljava/lang/String;
|
|
.locals 4
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/net/Uri;->isHierarchical()Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
const-string v0, "q"
|
|
|
|
.line 2
|
|
invoke-virtual {p0, v0}, Landroid/net/Uri;->getQueryParameters(Ljava/lang/String;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
.line 3
|
|
invoke-interface {p0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
move-object v1, p0
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
:goto_0
|
|
return-object v1
|
|
|
|
.line 4
|
|
:cond_1
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getEncodedSchemeSpecificPart()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
const-string v0, "q="
|
|
|
|
.line 5
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 6
|
|
array-length v0, p0
|
|
|
|
const/4 v3, 0x2
|
|
|
|
if-ge v0, v3, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v0, 0x1
|
|
|
|
aget-object p0, p0, v0
|
|
|
|
const-string v0, "&"
|
|
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
aget-object v1, p0, v2
|
|
|
|
:goto_1
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public static e(Ljava/lang/String;)Z
|
|
.locals 3
|
|
|
|
const-string v0, ","
|
|
|
|
.line 1
|
|
invoke-virtual {p0, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
.line 2
|
|
array-length v0, p0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-ne v0, v2, :cond_0
|
|
|
|
.line 3
|
|
:try_start_0
|
|
aget-object v0, p0, v1
|
|
|
|
invoke-static {v0}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 4
|
|
aget-object p0, p0, v0
|
|
|
|
invoke-static {p0}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return v0
|
|
|
|
:catch_0
|
|
:cond_0
|
|
return v1
|
|
.end method
|
|
|
|
.method public static f(Landroid/content/Context;Landroid/content/Intent;)V
|
|
.locals 4
|
|
.annotation build Landroidx/annotation/VisibleForTesting;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 3
|
|
invoke-virtual {p1}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
.line 4
|
|
invoke-virtual {v2}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3, v0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 5
|
|
:try_start_0
|
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
|
|
|
move-result-object p0
|
|
|
|
const/16 v0, 0x80
|
|
|
|
invoke-virtual {p0, v2, v0}, Landroid/content/pm/PackageManager;->getServiceInfo(Landroid/content/ComponentName;I)Landroid/content/pm/ServiceInfo;
|
|
:try_end_0
|
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
.line 6
|
|
:catch_0
|
|
new-instance p0, Ljava/security/InvalidParameterException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "Intent does not have the CarAppService\'s ComponentName as its target"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Ljava/security/InvalidParameterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_0
|
|
const-string p0, "androidx.car.app.action.NAVIGATE"
|
|
|
|
.line 7
|
|
invoke-static {v1, p0}, Ljava/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
.line 8
|
|
invoke-static {p1}, Ln0/d;->g(Landroid/content/Intent;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const-string p0, "android.intent.action.DIAL"
|
|
|
|
.line 9
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_4
|
|
|
|
const-string p0, "android.intent.action.CALL"
|
|
|
|
invoke-virtual {p0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
if-nez v2, :cond_3
|
|
|
|
.line 10
|
|
new-instance p0, Ljava/security/InvalidParameterException;
|
|
|
|
const-string p1, "The intent is not for a supported action"
|
|
|
|
invoke-direct {p0, p1}, Ljava/security/InvalidParameterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 11
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/SecurityException;
|
|
|
|
const-string p1, "Explicitly starting a separate app is not supported"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 12
|
|
:cond_4
|
|
:goto_0
|
|
invoke-static {p1}, Ln0/d;->h(Landroid/content/Intent;)V
|
|
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public static g(Landroid/content/Intent;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getDataString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, ""
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getDataString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
const-string v1, "geo:"
|
|
|
|
.line 2
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getData()Landroid/net/Uri;
|
|
|
|
move-result-object p0
|
|
|
|
.line 4
|
|
invoke-static {p0}, Ln0/d;->d(Landroid/net/Uri;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
.line 5
|
|
invoke-virtual {p0}, Landroid/net/Uri;->getEncodedSchemeSpecificPart()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p0}, Ln0/d;->e(Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
.line 6
|
|
:cond_1
|
|
new-instance p0, Ljava/security/InvalidParameterException;
|
|
|
|
const-string v0, "Navigation intent has neither a location nor a query string"
|
|
|
|
invoke-direct {p0, v0}, Ljava/security/InvalidParameterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
return-void
|
|
|
|
.line 7
|
|
:cond_3
|
|
new-instance p0, Ljava/security/InvalidParameterException;
|
|
|
|
const-string v0, "Navigation intent has a malformed uri"
|
|
|
|
invoke-direct {p0, v0}, Ljava/security/InvalidParameterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static h(Landroid/content/Intent;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getDataString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const-string v0, ""
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getDataString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
const-string v1, "tel:"
|
|
|
|
.line 2
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
.line 3
|
|
invoke-virtual {p0}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return-void
|
|
|
|
.line 4
|
|
:cond_1
|
|
new-instance p0, Ljava/lang/SecurityException;
|
|
|
|
const-string v0, "Phone intent cannot have a component"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
.line 5
|
|
:cond_2
|
|
new-instance p0, Ljava/security/InvalidParameterException;
|
|
|
|
const-string v0, "Phone intent data is not properly formatted"
|
|
|
|
invoke-direct {p0, v0}, Ljava/security/InvalidParameterException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|