package com.kwai.sodler.lib.kwai.b; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.Resources; import androidx.appcompat.view.ContextThemeWrapper; import com.kwad.sdk.utils.r; /* access modifiers changed from: package-private */ public final class d extends ContextThemeWrapper implements b { private Resources.Theme aRt; private int aRu; private final ContextThemeWrapper aRv; private String bLp; public d(ContextThemeWrapper contextThemeWrapper, String str) { super(contextThemeWrapper, contextThemeWrapper.getThemeResId()); this.aRv = contextThemeWrapper; this.bLp = str; this.aRu = ((Integer) r.a((Object) contextThemeWrapper, "getThemeResId", new Object[0])).intValue(); } public final Context getApplicationContext() { return a.aF(super.getApplicationContext(), this.bLp); } public final Context getBaseContext() { return this.aRv; } public final ClassLoader getClassLoader() { return a.b(super.getClassLoader(), this.bLp); } @Override // com.kwai.sodler.lib.kwai.b.b public final Context getDelegatedContext() { return this.aRv; } @Override // androidx.appcompat.view.ContextThemeWrapper public final Resources getResources() { return a.a(super.getResources(), this.bLp); } @Override // android.content.Context, android.content.ContextWrapper, androidx.appcompat.view.ContextThemeWrapper public final Object getSystemService(String str) { return a.wrapSystemService(this.aRv.getSystemService(str), str, this); } @Override // androidx.appcompat.view.ContextThemeWrapper public final Resources.Theme getTheme() { Resources.Theme theme; try { theme = super.getTheme(); } catch (Exception e) { e.printStackTrace(); theme = null; } Resources.Theme theme2 = this.aRt; if (theme2 == null || theme2 == theme) { this.aRt = a.a(theme, theme2, this.aRu, this.bLp); } return this.aRt; } public final void registerComponentCallbacks(ComponentCallbacks componentCallbacks) { this.aRv.registerComponentCallbacks(componentCallbacks); } @Override // androidx.appcompat.view.ContextThemeWrapper public final void setTheme(int i) { this.aRu = i; super.setTheme(i); } public final void unregisterComponentCallbacks(ComponentCallbacks componentCallbacks) { this.aRv.unregisterComponentCallbacks(componentCallbacks); } }