Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package dagger.hilt.android.internal;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class Contexts {
|
||||
private Contexts() {
|
||||
}
|
||||
|
||||
public static Application getApplication(Context context) {
|
||||
if (context instanceof Application) {
|
||||
return (Application) context;
|
||||
}
|
||||
Context context2 = context;
|
||||
while (context2 instanceof ContextWrapper) {
|
||||
context2 = ((ContextWrapper) context2).getBaseContext();
|
||||
if (context2 instanceof Application) {
|
||||
return (Application) context2;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Could not find an Application in the given context: " + context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user