2019-07-24 11:27:29 +00:00
.class public final L androidx/core/app/NavUtils ;
.super L java/lang/Object ;
.source "NavUtils.java"
# static fields
.field public static final PARENT_ACTIVITY : L java/lang/String ; = "android.support.PARENT_ACTIVITY"
.field private static final TAG : L java/lang/String ; = "NavUtils"
# direct methods
.method private constructor <init> ( ) V
.locals 0
invoke-direct { p0 } , L java/lang/Object ;-> <init> ( ) V
return-void
.end method
.method public static getParentActivityIntent ( L android/app/Activity ;) L android/content/Intent ;
.locals 3
. param p0 # Landroid/app/Activity;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
sget v0 , L android/os/Build$VERSION ;-> SDK_INT : I
const/16 v1 , 0x10
if-lt v0 , v1 , :cond_0
invoke-virtual { p0 } , L android/app/Activity ;-> getParentActivityIntent ( ) L android/content/Intent ;
move-result-object v0
if-eqz v0 , :cond_0
return-object v0
:cond_0
invoke-static { p0 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/app/Activity ;) L java/lang/String ;
move-result-object v0
const/4 v1 , 0x0
if-nez v0 , :cond_1
return-object v1
:cond_1
new-instance v2 , L android/content/ComponentName ;
invoke-direct { v2 , p0 , v0 } , L android/content/ComponentName ;-> <init> ( L android/content/Context ;L java/lang/String ;) V
:try_start_0
invoke-static { p0 , v2 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object p0
if-nez p0 , :cond_2
invoke-static { v2 } , L android/content/Intent ;-> makeMainActivity ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
return-object p0
:cond_2
new-instance p0 , L android/content/Intent ;
invoke-direct { p0 } , L android/content/Intent ;-> <init> ( ) V
invoke-virtual { p0 , v2 } , L android/content/Intent ;-> setComponent ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
:try_end_0
.catch L android/content/pm/PackageManager$NameNotFoundException ; { :try_start_0 . . :try_end_0 } :catch_0
return-object p0
:catch_0
new-instance p0 , L java/lang/StringBuilder ;
const-string v2 , "getParentActivityIntent: bad parentActivityName \'"
invoke-direct { p0 , v2 } , L java/lang/StringBuilder ;-> <init> ( L java/lang/String ;) V
invoke-virtual { p0 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string v0 , "\' in manifest"
invoke-virtual { p0 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { p0 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object p0
const-string v0 , "NavUtils"
invoke-static { v0 , p0 } , L android/util/Log ;-> e ( L java/lang/String ;L java/lang/String ;) I
return-object v1
.end method
.method public static getParentActivityIntent ( L android/content/Context ;L android/content/ComponentName ;) L android/content/Intent ;
.locals 2
. param p0 # Landroid/content/Context;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p1 # Landroid/content/ComponentName;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
.annotation system L dalvik/annotation/Throws ;
value = {
L android/content/pm/PackageManager$NameNotFoundException ;
}
.end annotation
invoke-static { p0 , p1 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object v0
if-nez v0 , :cond_0
const/4 p0 , 0x0
return-object p0
:cond_0
new-instance v1 , L android/content/ComponentName ;
invoke-virtual { p1 } , L android/content/ComponentName ;-> getPackageName ( ) L java/lang/String ;
move-result-object p1
invoke-direct { v1 , p1 , v0 } , L android/content/ComponentName ;-> <init> ( L java/lang/String ;L java/lang/String ;) V
invoke-static { p0 , v1 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object p0
if-nez p0 , :cond_1
invoke-static { v1 } , L android/content/Intent ;-> makeMainActivity ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
return-object p0
:cond_1
new-instance p0 , L android/content/Intent ;
invoke-direct { p0 } , L android/content/Intent ;-> <init> ( ) V
invoke-virtual { p0 , v1 } , L android/content/Intent ;-> setComponent ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
return-object p0
.end method
.method public static getParentActivityIntent ( L android/content/Context ;L java/lang/Class ;) L android/content/Intent ;
.locals 1
. param p0 # Landroid/content/Context;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p1 # Ljava/lang/Class;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
.annotation system L dalvik/annotation/Signature ;
value = {
"(" ,
"Landroid/content/Context;" ,
"Ljava/lang/Class<" ,
"*>;)" ,
"Landroid/content/Intent;"
}
.end annotation
.annotation system L dalvik/annotation/Throws ;
value = {
L android/content/pm/PackageManager$NameNotFoundException ;
}
.end annotation
new-instance v0 , L android/content/ComponentName ;
invoke-direct { v0 , p0 , p1 } , L android/content/ComponentName ;-> <init> ( L android/content/Context ;L java/lang/Class ;) V
invoke-static { p0 , v0 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object p1
if-nez p1 , :cond_0
const/4 p0 , 0x0
return-object p0
:cond_0
new-instance v0 , L android/content/ComponentName ;
invoke-direct { v0 , p0 , p1 } , L android/content/ComponentName ;-> <init> ( L android/content/Context ;L java/lang/String ;) V
invoke-static { p0 , v0 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object p0
if-nez p0 , :cond_1
invoke-static { v0 } , L android/content/Intent ;-> makeMainActivity ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
return-object p0
:cond_1
new-instance p0 , L android/content/Intent ;
invoke-direct { p0 } , L android/content/Intent ;-> <init> ( ) V
invoke-virtual { p0 , v0 } , L android/content/Intent ;-> setComponent ( L android/content/ComponentName ;) L android/content/Intent ;
move-result-object p0
return-object p0
.end method
.method public static getParentActivityName ( L android/app/Activity ;) L java/lang/String ;
.locals 1
. param p0 # Landroid/app/Activity;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
:try_start_0
invoke-virtual { p0 } , L android/app/Activity ;-> getComponentName ( ) L android/content/ComponentName ;
move-result-object v0
invoke-static { p0 , v0 } , L androidx/core/app/NavUtils ;-> getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
move-result-object p0
:try_end_0
.catch L android/content/pm/PackageManager$NameNotFoundException ; { :try_start_0 . . :try_end_0 } :catch_0
return-object p0
:catch_0
move-exception p0
new-instance v0 , L java/lang/IllegalArgumentException ;
invoke-direct { v0 , p0 } , L java/lang/IllegalArgumentException ;-> <init> ( L java/lang/Throwable ;) V
throw v0
.end method
.method public static getParentActivityName ( L android/content/Context ;L android/content/ComponentName ;) L java/lang/String ;
.locals 2
. param p0 # Landroid/content/Context;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p1 # Landroid/content/ComponentName;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
.annotation build L androidx/annotation/Nullable ;
.end annotation
.annotation system L dalvik/annotation/Throws ;
value = {
L android/content/pm/PackageManager$NameNotFoundException ;
}
.end annotation
invoke-virtual { p0 } , L android/content/Context ;-> getPackageManager ( ) L android/content/pm/PackageManager ;
move-result-object v0
2019-07-26 02:05:13 +00:00
sget v1 , L android/os/Build$VERSION ;-> SDK_INT : I
const/16 v1 , 0x280
2019-07-24 11:27:29 +00:00
invoke-virtual { v0 , p1 , v1 } , L android/content/pm/PackageManager ;-> getActivityInfo ( L android/content/ComponentName ;I ) L android/content/pm/ActivityInfo ;
move-result-object p1
sget v0 , L android/os/Build$VERSION ;-> SDK_INT : I
const/16 v1 , 0x10
if-lt v0 , v1 , :cond_0
iget-object v0 , p1 , L android/content/pm/ActivityInfo ;-> parentActivityName : L java/lang/String ;
if-eqz v0 , :cond_0
return-object v0
:cond_0
iget-object v0 , p1 , L android/content/pm/ActivityInfo ;-> metaData : L android/os/Bundle ;
const/4 v1 , 0x0
if-nez v0 , :cond_1
return-object v1
:cond_1
iget-object p1 , p1 , L android/content/pm/ActivityInfo ;-> metaData : L android/os/Bundle ;
const-string v0 , "android.support.PARENT_ACTIVITY"
invoke-virtual { p1 , v0 } , L android/os/Bundle ;-> getString ( L java/lang/String ;) L java/lang/String ;
move-result-object p1
if-nez p1 , :cond_2
return-object v1
:cond_2
const/4 v0 , 0x0
invoke-virtual { p1 , v0 } , L java/lang/String ;-> charAt ( I ) C
move-result v0
const/16 v1 , 0x2e
if-ne v0 , v1 , :cond_3
new-instance v0 , L java/lang/StringBuilder ;
invoke-direct { v0 } , L java/lang/StringBuilder ;-> <init> ( ) V
invoke-virtual { p0 } , L android/content/Context ;-> getPackageName ( ) L java/lang/String ;
move-result-object p0
invoke-virtual { v0 , p0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v0 , p1 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v0 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object p1
:cond_3
return-object p1
.end method
.method public static navigateUpFromSameTask ( L android/app/Activity ;) V
.locals 3
. param p0 # Landroid/app/Activity;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
invoke-static { p0 } , L androidx/core/app/NavUtils ;-> getParentActivityIntent ( L android/app/Activity ;) L android/content/Intent ;
move-result-object v0
if-eqz v0 , :cond_0
invoke-static { p0 , v0 } , L androidx/core/app/NavUtils ;-> navigateUpTo ( L android/app/Activity ;L android/content/Intent ;) V
return-void
:cond_0
new-instance v0 , L java/lang/IllegalArgumentException ;
new-instance v1 , L java/lang/StringBuilder ;
const-string v2 , "Activity "
invoke-direct { v1 , v2 } , L java/lang/StringBuilder ;-> <init> ( L java/lang/String ;) V
invoke-virtual { p0 } , L java/lang/Object ;-> getClass ( ) L java/lang/Class ;
move-result-object p0
invoke-virtual { p0 } , L java/lang/Class ;-> getSimpleName ( ) L java/lang/String ;
move-result-object p0
invoke-virtual { v1 , p0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string p0 , " does not have a parent activity name specified. (Did you forget to add the android.support.PARENT_ACTIVITY <meta-data> element in your manifest?)"
invoke-virtual { v1 , p0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object p0
invoke-direct { v0 , p0 } , L java/lang/IllegalArgumentException ;-> <init> ( L java/lang/String ;) V
throw v0
.end method
.method public static navigateUpTo ( L android/app/Activity ;L android/content/Intent ;) V
.locals 2
. param p0 # Landroid/app/Activity;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p1 # Landroid/content/Intent;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
sget v0 , L android/os/Build$VERSION ;-> SDK_INT : I
const/16 v1 , 0x10
if-lt v0 , v1 , :cond_0
invoke-virtual { p0 , p1 } , L android/app/Activity ;-> navigateUpTo ( L android/content/Intent ;) Z
return-void
:cond_0
const/high16 v0 , 0x4000000
invoke-virtual { p1 , v0 } , L android/content/Intent ;-> addFlags ( I ) L android/content/Intent ;
invoke-virtual { p0 , p1 } , L android/app/Activity ;-> startActivity ( L android/content/Intent ;) V
invoke-virtual { p0 } , L android/app/Activity ;-> finish ( ) V
return-void
.end method
.method public static shouldUpRecreateTask ( L android/app/Activity ;L android/content/Intent ;) Z
.locals 2
. param p0 # Landroid/app/Activity;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p1 # Landroid/content/Intent;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
sget v0 , L android/os/Build$VERSION ;-> SDK_INT : I
const/16 v1 , 0x10
if-lt v0 , v1 , :cond_0
invoke-virtual { p0 , p1 } , L android/app/Activity ;-> shouldUpRecreateTask ( L android/content/Intent ;) Z
move-result p0
return p0
:cond_0
invoke-virtual { p0 } , L android/app/Activity ;-> getIntent ( ) L android/content/Intent ;
move-result-object p0
invoke-virtual { p0 } , L android/content/Intent ;-> getAction ( ) L java/lang/String ;
move-result-object p0
if-eqz p0 , :cond_1
const-string p1 , "android.intent.action.MAIN"
invoke-virtual { p0 , p1 } , L java/lang/String ;-> equals ( L java/lang/Object ;) Z
move-result p0
if-nez p0 , :cond_1
const/4 p0 , 0x1
return p0
:cond_1
const/4 p0 , 0x0
return p0
.end method