apkfuckery/com.discord/smali/androidx/core/app/ShareCompat$IntentReader.smali

765 lines
20 KiB
Smali

.class public Landroidx/core/app/ShareCompat$IntentReader;
.super Ljava/lang/Object;
.source "ShareCompat.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/core/app/ShareCompat;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "IntentReader"
.end annotation
# static fields
.field public static final TAG:Ljava/lang/String; = "IntentReader"
# instance fields
.field public final mCallingActivity:Landroid/content/ComponentName;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public final mCallingPackage:Ljava/lang/String;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
.field public final mContext:Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end field
.field public final mIntent:Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end field
.field public mStreams:Ljava/util/ArrayList;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Landroid/net/Uri;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
.param p1 # 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
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
invoke-static {p1}, Landroidx/core/util/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroid/content/Context;
iput-object p1, p0, Landroidx/core/app/ShareCompat$IntentReader;->mContext:Landroid/content/Context;
invoke-static {p2}, Landroidx/core/util/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroid/content/Intent;
iput-object p1, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-static {p2}, Landroidx/core/app/ShareCompat;->getCallingPackage(Landroid/content/Intent;)Ljava/lang/String;
move-result-object p1
iput-object p1, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
invoke-static {p2}, Landroidx/core/app/ShareCompat;->getCallingActivity(Landroid/content/Intent;)Landroid/content/ComponentName;
move-result-object p1
iput-object p1, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingActivity:Landroid/content/ComponentName;
return-void
.end method
.method public static from(Landroid/app/Activity;)Landroidx/core/app/ShareCompat$IntentReader;
.locals 1
.param p0 # Landroid/app/Activity;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
invoke-static {p0}, Landroidx/core/util/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/content/Context;
invoke-virtual {p0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;
move-result-object p0
invoke-static {v0, p0}, Landroidx/core/app/ShareCompat$IntentReader;->from(Landroid/content/Context;Landroid/content/Intent;)Landroidx/core/app/ShareCompat$IntentReader;
move-result-object p0
return-object p0
.end method
.method public static from(Landroid/content/Context;Landroid/content/Intent;)Landroidx/core/app/ShareCompat$IntentReader;
.locals 1
.param p0 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
new-instance v0, Landroidx/core/app/ShareCompat$IntentReader;
invoke-direct {v0, p0, p1}, Landroidx/core/app/ShareCompat$IntentReader;-><init>(Landroid/content/Context;Landroid/content/Intent;)V
return-object v0
.end method
.method public static withinStyle(Ljava/lang/StringBuilder;Ljava/lang/CharSequence;II)V
.locals 3
:goto_0
if-ge p2, p3, :cond_7
invoke-interface {p1, p2}, Ljava/lang/CharSequence;->charAt(I)C
move-result v0
const/16 v1, 0x3c
if-ne v0, v1, :cond_0
const-string v0, "&lt;"
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_3
:cond_0
const/16 v1, 0x3e
if-ne v0, v1, :cond_1
const-string v0, "&gt;"
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_3
:cond_1
const/16 v1, 0x26
if-ne v0, v1, :cond_2
const-string v0, "&amp;"
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_3
:cond_2
const/16 v1, 0x7e
if-gt v0, v1, :cond_6
const/16 v1, 0x20
if-ge v0, v1, :cond_3
goto :goto_2
:cond_3
if-ne v0, v1, :cond_5
:goto_1
add-int/lit8 v0, p2, 0x1
if-ge v0, p3, :cond_4
invoke-interface {p1, v0}, Ljava/lang/CharSequence;->charAt(I)C
move-result v2
if-ne v2, v1, :cond_4
const-string p2, "&nbsp;"
invoke-virtual {p0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move p2, v0
goto :goto_1
:cond_4
invoke-virtual {p0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
goto :goto_3
:cond_5
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
goto :goto_3
:cond_6
:goto_2
const-string v1, "&#"
invoke-virtual {p0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v0, ";"
invoke-virtual {p0, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
:goto_3
add-int/lit8 p2, p2, 0x1
goto :goto_0
:cond_7
return-void
.end method
# virtual methods
.method public getCallingActivity()Landroid/content/ComponentName;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingActivity:Landroid/content/ComponentName;
return-object v0
.end method
.method public getCallingActivityIcon()Landroid/graphics/drawable/Drawable;
.locals 4
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingActivity:Landroid/content/ComponentName;
const/4 v1, 0x0
if-nez v0, :cond_0
return-object v1
:cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
:try_start_0
iget-object v2, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingActivity:Landroid/content/ComponentName;
invoke-virtual {v0, v2}, Landroid/content/pm/PackageManager;->getActivityIcon(Landroid/content/ComponentName;)Landroid/graphics/drawable/Drawable;
move-result-object v0
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
const-string v2, "IntentReader"
const-string v3, "Could not retrieve icon for calling activity"
invoke-static {v2, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-object v1
.end method
.method public getCallingApplicationIcon()Landroid/graphics/drawable/Drawable;
.locals 4
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
const/4 v1, 0x0
if-nez v0, :cond_0
return-object v1
:cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
:try_start_0
iget-object v2, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
invoke-virtual {v0, v2}, Landroid/content/pm/PackageManager;->getApplicationIcon(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
move-result-object v0
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
const-string v2, "IntentReader"
const-string v3, "Could not retrieve icon for calling application"
invoke-static {v2, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-object v1
.end method
.method public getCallingApplicationLabel()Ljava/lang/CharSequence;
.locals 4
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
const/4 v1, 0x0
if-nez v0, :cond_0
return-object v1
:cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v0
:try_start_0
iget-object v2, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
const/4 v3, 0x0
invoke-virtual {v0, v2, v3}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
move-result-object v2
invoke-virtual {v0, v2}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v0
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
const-string v2, "IntentReader"
const-string v3, "Could not retrieve label for calling application"
invoke-static {v2, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
return-object v1
.end method
.method public getCallingPackage()Ljava/lang/String;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mCallingPackage:Ljava/lang/String;
return-object v0
.end method
.method public getEmailBcc()[Ljava/lang/String;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.BCC"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getEmailCc()[Ljava/lang/String;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.CC"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getEmailTo()[Ljava/lang/String;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.EMAIL"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getHtmlText()Ljava/lang/String;
.locals 3
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.HTML_TEXT"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_1
invoke-virtual {p0}, Landroidx/core/app/ShareCompat$IntentReader;->getText()Ljava/lang/CharSequence;
move-result-object v1
instance-of v2, v1, Landroid/text/Spanned;
if-eqz v2, :cond_0
check-cast v1, Landroid/text/Spanned;
invoke-static {v1}, Landroid/text/Html;->toHtml(Landroid/text/Spanned;)Ljava/lang/String;
move-result-object v0
goto :goto_0
:cond_0
if-eqz v1, :cond_1
invoke-static {v1}, Landroid/text/Html;->escapeHtml(Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v0
:cond_1
:goto_0
return-object v0
.end method
.method public getStream()Landroid/net/Uri;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.STREAM"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/net/Uri;
return-object v0
.end method
.method public getStream(I)Landroid/net/Uri;
.locals 3
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
const-string v1, "android.intent.extra.STREAM"
if-nez v0, :cond_0
invoke-virtual {p0}, Landroidx/core/app/ShareCompat$IntentReader;->isMultipleShare()Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableArrayListExtra(Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object v0
iput-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
:cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
if-eqz v0, :cond_1
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroid/net/Uri;
return-object p1
:cond_1
if-nez p1, :cond_2
iget-object p1, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {p1, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
move-result-object p1
check-cast p1, Landroid/net/Uri;
return-object p1
:cond_2
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
const-string v1, "Stream items available: "
invoke-static {v1}, Lf/e/c/a/a;->F(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {p0}, Landroidx/core/app/ShareCompat$IntentReader;->getStreamCount()I
move-result v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string v2, " index requested: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public getStreamCount()I
.locals 2
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
const-string v1, "android.intent.extra.STREAM"
if-nez v0, :cond_0
invoke-virtual {p0}, Landroidx/core/app/ShareCompat$IntentReader;->isMultipleShare()Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableArrayListExtra(Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object v0
iput-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
:cond_0
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mStreams:Ljava/util/ArrayList;
if-eqz v0, :cond_1
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
return v0
:cond_1
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0, v1}, Landroid/content/Intent;->hasExtra(Ljava/lang/String;)Z
move-result v0
return v0
.end method
.method public getSubject()Ljava/lang/String;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.SUBJECT"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public getText()Ljava/lang/CharSequence;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
const-string v1, "android.intent.extra.TEXT"
invoke-virtual {v0, v1}, Landroid/content/Intent;->getCharSequenceExtra(Ljava/lang/String;)Ljava/lang/CharSequence;
move-result-object v0
return-object v0
.end method
.method public getType()Ljava/lang/String;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0}, Landroid/content/Intent;->getType()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public isMultipleShare()Z
.locals 2
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "android.intent.action.SEND_MULTIPLE"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
return v0
.end method
.method public isShareIntent()Z
.locals 2
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "android.intent.action.SEND"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_1
const-string v1, "android.intent.action.SEND_MULTIPLE"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_0
goto :goto_0
:cond_0
const/4 v0, 0x0
goto :goto_1
:cond_1
:goto_0
const/4 v0, 0x1
:goto_1
return v0
.end method
.method public isSingleShare()Z
.locals 2
iget-object v0, p0, Landroidx/core/app/ShareCompat$IntentReader;->mIntent:Landroid/content/Intent;
invoke-virtual {v0}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "android.intent.action.SEND"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
return v0
.end method