package busidol.mobile.tower; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.Point; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.InputFilter; import android.util.Log; import android.view.Display; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.TextView; import com.google.android.gms.ads.RequestConfiguration; import com.igaworks.ssp.AdPopcornSSP; import i1.d; import i1.e; import i1.k; /* loaded from: classes.dex */ public class MainActivity extends Activity { /* renamed from: i, reason: collision with root package name */ public static String f3337i = "Activity"; /* renamed from: a, reason: collision with root package name */ public Handler f3338a; /* renamed from: b, reason: collision with root package name */ MainActivity f3339b; /* renamed from: c, reason: collision with root package name */ public k f3340c; /* renamed from: d, reason: collision with root package name */ public int f3341d; /* renamed from: e, reason: collision with root package name */ public int f3342e; /* renamed from: f, reason: collision with root package name */ public String f3343f; /* renamed from: g, reason: collision with root package name */ EditText f3344g; /* renamed from: h, reason: collision with root package name */ String f3345h = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; class a implements TextView.OnEditorActionListener { a() { } @Override // android.widget.TextView.OnEditorActionListener public boolean onEditorAction(TextView textView, int i10, KeyEvent keyEvent) { if (i10 != 6 && i10 != 5 && (keyEvent == null || keyEvent.getKeyCode() != 66 || keyEvent.getAction() != 0)) { return false; } MainActivity mainActivity = MainActivity.this; mainActivity.f3345h = mainActivity.f3344g.getText().toString(); ((InputMethodManager) MainActivity.this.getSystemService("input_method")).toggleSoftInput(1, 0); MainActivity.this.f3344g.getText().clear(); MainActivity.this.f3344g.setVisibility(4); MainActivity mainActivity2 = MainActivity.this; mainActivity2.f3340c.f10739a.c(mainActivity2.f3345h, mainActivity2.f3343f); return true; } } class b implements Runnable { b() { } @Override // java.lang.Runnable public void run() { MainActivity.this.f3344g.requestFocus(); ((InputMethodManager) MainActivity.this.getSystemService("input_method")).showSoftInput(MainActivity.this.f3344g, 0); } } public void a() { View decorView; Window window = getWindow(); if (window == null || (decorView = window.getDecorView()) == null) { return; } decorView.setSystemUiVisibility(5894); } /* JADX WARN: Removed duplicated region for block: B:25:0x009e */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public int b(int r3, java.lang.Boolean r4) { /* Method dump skipped, instructions count: 384 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: busidol.mobile.tower.MainActivity.b(int, java.lang.Boolean):int"); } public void c() { Display defaultDisplay = getWindowManager().getDefaultDisplay(); Point point = new Point(); defaultDisplay.getSize(point); this.f3341d = point.x; this.f3342e = point.y; } public void d() { PackageInfo packageInfo; try { packageInfo = this.f3339b.getPackageManager().getPackageInfo(this.f3339b.getPackageName(), 0); } catch (PackageManager.NameNotFoundException e10) { Log.e("Define", e10.getMessage()); packageInfo = null; } e.f10643w = packageInfo.versionName; e.f10644x = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED + packageInfo.versionCode; } public void e(String str, int i10) { this.f3343f = str; new Handler(Looper.getMainLooper()).postDelayed(new b(), 300L); this.f3344g.setFilters(new InputFilter[]{new InputFilter.LengthFilter(i10)}); this.f3344g.setVisibility(0); } public void f(int i10) { k kVar = this.f3340c; if (kVar != null) { kVar.t(i10); } } public void g(String str) { k kVar = this.f3340c; if (kVar != null) { kVar.u(str); } } @Override // android.app.Activity protected void onActivityResult(int i10, int i11, Intent intent) { k kVar; k1.a aVar; super.onActivityResult(i10, i11, intent); Log.e("onActivityResult", "requestCode" + i10); if (i10 != 9001 || (kVar = this.f3340c) == null || (aVar = kVar.f10750l) == null) { return; } aVar.g(i10, i11, intent); } @Override // android.app.Activity protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.activity_main); EditText editText = (EditText) findViewById(R.id.edit_name); this.f3344g = editText; editText.setVisibility(4); this.f3344g.setOnEditorActionListener(new a()); this.f3338a = new Handler(); this.f3339b = this; d(); this.f3340c = new k(this); c(); if (!AdPopcornSSP.isInitialized(this)) { AdPopcornSSP.init(this); } this.f3340c.h(); a(); } @Override // android.app.Activity protected void onDestroy() { super.onDestroy(); AdPopcornSSP.destroy(); Log.e(f3337i, "onDestroy"); } @Override // android.app.Activity, android.view.KeyEvent.Callback public boolean onKeyDown(int i10, KeyEvent keyEvent) { if (d.f10630g) { return true; } return this.f3340c.k(i10, keyEvent); } @Override // android.app.Activity protected void onPause() { super.onPause(); Log.e(f3337i, "onPause"); k kVar = this.f3340c; if (kVar != null) { kVar.l(); } } @Override // android.app.Activity protected void onResume() { super.onResume(); Log.e(f3337i, "onResume"); k kVar = this.f3340c; if (kVar != null) { kVar.m(); } } }