package com.ubt.jimu.user.view; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import butterknife.ButterKnife; import com.ubt.jimu.BaseActivity; import com.ubt.jimu.R; import com.ubt.jimu.base.entities.NSLocale; import com.ubt.jimu.user.view.adapter.CountryCodeAdapter; import java.util.ArrayList; import java.util.List; /* loaded from: classes2.dex */ public class CountryCodeActivity extends BaseActivity { private String a; private CountryCodeAdapter b; private List c = new ArrayList(); private Handler d = new Handler(); RecyclerView recyclerView; private void D0() { new Thread(new Runnable() { // from class: com.ubt.jimu.user.view.CountryCodeActivity.2 /* JADX WARN: Code restructure failed: missing block: B:40:0x00db, code lost: r0.close(); */ /* JADX WARN: Code restructure failed: missing block: B:42:?, code lost: return; */ /* JADX WARN: Code restructure failed: missing block: B:43:0x00df, code lost: r0 = move-exception; */ /* JADX WARN: Code restructure failed: missing block: B:44:0x00e0, code lost: r0.printStackTrace(); */ /* JADX WARN: Code restructure failed: missing block: B:45:0x00e3, code lost: return; */ @Override // java.lang.Runnable /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public void run() { /* r7 = this; r0 = 0 com.ubt.jimu.user.view.CountryCodeActivity r1 = com.ubt.jimu.user.view.CountryCodeActivity.this // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 android.content.res.Resources r1 = r1.getResources() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r2 = 2131755009(0x7f100001, float:1.9140885E38) java.io.InputStream r0 = r1.openRawResource(r2) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.io.InputStreamReader r1 = new java.io.InputStreamReader // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r1.(r0) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r2 = 51200(0xc800, float:7.1746E-41) java.nio.CharBuffer r2 = java.nio.CharBuffer.allocate(r2) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 int r1 = r1.read(r2) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r1 == 0) goto L23 r2.flip() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 L23: com.ubt.jimu.user.view.CountryCodeActivity$2$1 r1 = new com.ubt.jimu.user.view.CountryCodeActivity$2$1 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r1.(r7) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.reflect.Type r1 = r1.getType() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.google.gson.Gson r3 = new com.google.gson.Gson // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r3.() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r2 = r2.toString() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.Object r1 = r3.fromJson(r2, r1) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.util.List r1 = (java.util.List) r1 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r1 == 0) goto Ld9 int r2 = r1.size() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r2 != 0) goto L45 goto Ld9 L45: java.util.Locale r2 = com.ubt.jimu.utils.LocaleUtils.e() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r3 = r2.getLanguage() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.util.Locale r4 = java.util.Locale.CHINA // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r4 = r4.getLanguage() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 boolean r3 = r3.equals(r4) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r3 == 0) goto L71 java.util.Iterator r2 = r1.iterator() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 L5d: boolean r3 = r2.hasNext() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r3 == 0) goto Lbc java.lang.Object r3 = r2.next() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.ubt.jimu.base.entities.NSLocale r3 = (com.ubt.jimu.base.entities.NSLocale) r3 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r4 = r3.getChineseName() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r3.setName(r4) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 goto L5d L71: java.lang.String r2 = r2.getLanguage() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.util.Locale r3 = java.util.Locale.ENGLISH // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r3 = r3.getLanguage() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 boolean r2 = r2.equals(r3) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r2 == 0) goto L99 java.util.Iterator r2 = r1.iterator() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 L85: boolean r3 = r2.hasNext() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r3 == 0) goto Lbc java.lang.Object r3 = r2.next() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.ubt.jimu.base.entities.NSLocale r3 = (com.ubt.jimu.base.entities.NSLocale) r3 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r4 = r3.getName() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r3.setName(r4) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 goto L85 L99: java.util.Iterator r2 = r1.iterator() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 L9d: boolean r3 = r2.hasNext() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r3 == 0) goto Lbc java.lang.Object r3 = r2.next() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.ubt.jimu.base.entities.NSLocale r3 = (com.ubt.jimu.base.entities.NSLocale) r3 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.util.Locale r4 = new java.util.Locale // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r5 = "" java.lang.String r6 = r3.getCode() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r4.(r5, r6) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.lang.String r4 = r4.getDisplayCountry() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r3.setName(r4) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 goto L9d Lbc: com.ubt.jimu.user.view.CountryCodeActivity r2 = com.ubt.jimu.user.view.CountryCodeActivity.this // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 java.util.List r2 = com.ubt.jimu.user.view.CountryCodeActivity.a(r2) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r2.addAll(r1) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.ubt.jimu.user.view.CountryCodeActivity r1 = com.ubt.jimu.user.view.CountryCodeActivity.this // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 android.os.Handler r1 = com.ubt.jimu.user.view.CountryCodeActivity.c(r1) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 com.ubt.jimu.user.view.CountryCodeActivity$2$2 r2 = new com.ubt.jimu.user.view.CountryCodeActivity$2$2 // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r2.() // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 r1.post(r2) // Catch: java.lang.Throwable -> Le4 java.lang.Exception -> Le6 if (r0 == 0) goto Lf4 r0.close() // Catch: java.lang.Exception -> Lf0 goto Lf4 Ld9: if (r0 == 0) goto Le3 r0.close() // Catch: java.lang.Exception -> Ldf goto Le3 Ldf: r0 = move-exception r0.printStackTrace() Le3: return Le4: r1 = move-exception goto Lf5 Le6: r1 = move-exception r1.printStackTrace() // Catch: java.lang.Throwable -> Le4 if (r0 == 0) goto Lf4 r0.close() // Catch: java.lang.Exception -> Lf0 goto Lf4 Lf0: r0 = move-exception r0.printStackTrace() Lf4: return Lf5: if (r0 == 0) goto Lff r0.close() // Catch: java.lang.Exception -> Lfb goto Lff Lfb: r0 = move-exception r0.printStackTrace() Lff: throw r1 */ throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.user.view.CountryCodeActivity.AnonymousClass2.run():void"); } }).start(); } private void initView() { this.recyclerView.setLayoutManager(new LinearLayoutManager(this, 1, false)); this.b = new CountryCodeAdapter(this, this.c, this.a); this.b.a(new CountryCodeAdapter.Callback() { // from class: com.ubt.jimu.user.view.CountryCodeActivity.1 @Override // com.ubt.jimu.user.view.adapter.CountryCodeAdapter.Callback public void a(String str, String str2) { Intent intent = new Intent(); intent.putExtra("country_code", str); intent.putExtra("country_name", str2); CountryCodeActivity.this.setResult(-1, intent); CountryCodeActivity.this.finish(); } }); this.recyclerView.setAdapter(this.b); D0(); } @Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.activity_country_code); ButterKnife.a(this); this.a = getIntent().getStringExtra("selected_code"); initView(); } @Override // com.ubt.jimu.BaseActivity, com.ubt.jimu.ScreenRotationManageActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity protected void onDestroy() { super.onDestroy(); this.d.removeCallbacksAndMessages(null); } @Override // com.ubt.jimu.BaseActivity public void relayout() { } }