package com.kwad.sdk.api.proxy; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Bundle; import android.os.SystemClock; import android.view.KeyEvent; import android.view.LayoutInflater; import com.kwad.sdk.api.KsAdSDK; import com.kwad.sdk.api.core.ComponentDestroyer; import com.kwad.sdk.api.loader.Loader; import com.kwad.sdk.api.loader.Wrapper; public abstract class BaseProxyActivity extends Activity { static final /* synthetic */ boolean $assertionsDisabled = false; public static final String KEY_START_TIME = "key_start_time"; private IActivityProxy mDelegate; /* access modifiers changed from: protected */ public void attachBaseContext(Context context) { super.attachBaseContext(Wrapper.wrapContextIfNeed(context)); IActivityProxy delegate = getDelegate(context); this.mDelegate = delegate; delegate.setActivity(this); } public Context createConfigurationContext(Configuration configuration) { return Wrapper.wrapContextIfNeed(super.createConfigurationContext(configuration)); } /* access modifiers changed from: protected */ public abstract IActivityProxy getDelegate(Context context); public Intent getIntent() { ClassLoader externalClassLoader = Loader.get().getExternalClassLoader(); if (externalClassLoader == null) { return super.getIntent(); } Intent intent = super.getIntent(); intent.setExtrasClassLoader(externalClassLoader); return intent; } public LayoutInflater getLayoutInflater() { return Wrapper.wrapInflaterIfNeed(super.getLayoutInflater()); } public Resources getResources() { Resources resources = super.getResources(); Resources externalResource = Loader.get().getExternalResource(); return externalResource != null ? externalResource : resources; } /* access modifiers changed from: protected */ public void onActivityResult(int i, int i2, Intent intent) { super.onActivityResult(i, i2, intent); this.mDelegate.onActivityResult(i, i2, intent); } /* access modifiers changed from: protected */ public void onApplyThemeResource(Resources.Theme theme, int i, boolean z) { super.onApplyThemeResource(theme, i, z); this.mDelegate.onApplyThemeResource(theme, i, z); } public void onBackPressed() { this.mDelegate.onBackPressed(); } /* access modifiers changed from: protected */ public void onChildTitleChanged(Activity activity, CharSequence charSequence) { super.onChildTitleChanged(activity, charSequence); this.mDelegate.onChildTitleChanged(activity, charSequence); } public void onConfigurationChanged(Configuration configuration) { super.onConfigurationChanged(configuration); this.mDelegate.onConfigurationChanged(configuration); } /* access modifiers changed from: protected */ public void onCreate(Bundle bundle) { this.mDelegate.onPreCreate(bundle); try { super.onCreate(bundle); } catch (Throwable th) { KsAdSDK.re(th); } this.mDelegate.onCreate(bundle); } /* access modifiers changed from: protected */ public void onDestroy() { this.mDelegate.onPreDestroy(); super.onDestroy(); this.mDelegate.onDestroy(); ComponentDestroyer.destroyActivity(this); Wrapper.onDestroy(this); } public boolean onKeyDown(int i, KeyEvent keyEvent) { return this.mDelegate.onKeyDown(i, keyEvent); } public boolean onKeyLongPress(int i, KeyEvent keyEvent) { return this.mDelegate.onKeyLongPress(i, keyEvent); } public boolean onKeyUp(int i, KeyEvent keyEvent) { return this.mDelegate.onKeyUp(i, keyEvent); } /* access modifiers changed from: protected */ public void onNewIntent(Intent intent) { super.onNewIntent(intent); this.mDelegate.onNewIntent(intent); } /* access modifiers changed from: protected */ public void onPause() { this.mDelegate.onPrePause(); super.onPause(); this.mDelegate.onPause(); } /* access modifiers changed from: protected */ public void onPostCreate(Bundle bundle) { super.onPostCreate(bundle); this.mDelegate.onPostCreate(bundle); } /* access modifiers changed from: protected */ public void onPostResume() { super.onPostResume(); this.mDelegate.onPostResume(); } /* access modifiers changed from: protected */ public void onRestart() { super.onRestart(); this.mDelegate.onRestart(); } /* access modifiers changed from: protected */ public void onRestoreInstanceState(Bundle bundle) { super.onRestoreInstanceState(bundle); this.mDelegate.onRestoreInstanceState(bundle); } /* access modifiers changed from: protected */ public void onResume() { this.mDelegate.onPreResume(); super.onResume(); this.mDelegate.onResume(); } /* access modifiers changed from: protected */ public void onSaveInstanceState(Bundle bundle) { this.mDelegate.onPreSaveInstanceState(bundle); super.onSaveInstanceState(bundle); this.mDelegate.onSaveInstanceState(bundle); } /* access modifiers changed from: protected */ public void onStart() { this.mDelegate.onPreStart(); super.onStart(); this.mDelegate.onStart(); } /* access modifiers changed from: protected */ public void onStop() { this.mDelegate.onPreStop(); super.onStop(); this.mDelegate.onStop(); } /* access modifiers changed from: protected */ public void onTitleChanged(CharSequence charSequence, int i) { super.onTitleChanged(charSequence, i); this.mDelegate.onTitleChanged(charSequence, i); } /* access modifiers changed from: protected */ public void onUserLeaveHint() { super.onUserLeaveHint(); this.mDelegate.onUserLeaveHint(); } public void startActivity(Intent intent) { if (intent != null) { intent.putExtra("key_start_time", SystemClock.uptimeMillis()); } super.startActivity(intent); } public void superOnBackPressed() { super.onBackPressed(); } public boolean superOnKeyDown(int i, KeyEvent keyEvent) { return super.onKeyDown(i, keyEvent); } public boolean superOnKeyLongPress(int i, KeyEvent keyEvent) { return super.onKeyLongPress(i, keyEvent); } public boolean superOnKeyUp(int i, KeyEvent keyEvent) { return super.onKeyUp(i, keyEvent); } }