正在查看: Kahramaa v15.23.3 应用的 SettingsFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Kahramaa v15.23.3 应用的 SettingsFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.qa.kahramaa.kahramaa.settings.fragments;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.content.ContentProviderOperation;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.Switch;
import android.widget.TextView;
import androidx.activity.x;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.b;
import androidx.fragment.app.m;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.qa.kahramaa.kahramaa.base.activities.MainActivity;
import com.qa.kahramaa.kahramaa.base.retrofit.WebServiceFactoryV2;
import com.qa.kahramaa.kahramaa.base.retrofit.h;
import com.qa.kahramaa.kahramaa.base.ui.FullDrawerLayout;
import com.qa.kahramaa.kahramaa.base.ui.views.AnyTextView;
import com.qa.kahramaa.kahramaa.bookappointment.fragments.BookAppointmentLaunchFragment;
import com.qa.kahramaa.kahramaa.home.fragments.ServicesFragmentNewUI;
import com.qa.kahramaa.kahramaa.home.fragments.SupportFragmentNewUI;
import com.qa.kahramaa.kahramaa.settings.fragments.SettingsFragment;
import ib.r;
import ib.s;
import ib.v;
import ib.w;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import jb.f;
import r6.e0;
import r6.g0;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class SettingsFragment extends hb.a {
public static final int f4998q0 = 0;
@BindView
public ImageView app_arrow;
@BindView
public ImageView close_button;
@BindView
public LinearLayout coordinatorLayout;
@BindView
public FullDrawerLayout drawer_layout;
@BindView
public ImageView iv_notification;
public ArrayList<ContentProviderOperation> f4999k0;
public v f5000l0;
@BindView
public AnyTextView language_data;
@BindView
public LinearLayout ll_app_lock;
@BindView
public LinearLayout ll_language;
@BindView
public LinearLayout ll_logout;
@BindView
public LinearLayout ll_my_profile;
@BindView
public LinearLayout ll_terms;
@BindView
public ImageView logout_arrow;
@BindView
public RecyclerView lst_menu_items;
public List<oc.d> f5001m0;
public mc.d f5002n0;
@BindView
public AnyTextView nav_Qid_text;
@BindView
public AnyTextView nav_serial_number;
@BindView
public AnyTextView nav_userName;
@BindView
public AnyTextView nav_userQid;
@BindView
public AnyTextView nav_userShortName;
@BindView
public AnyTextView nav_version_number;
@BindView
public Switch notification_switch;
public String f5003o0;
public String f5004p0 = "";
@BindView
public RadioButton rdbn_arabic;
@BindView
public RadioButton rdbn_english;
@BindView
public AnyTextView short_name;
@BindView
public ImageView tnc_arrow;
@BindView
public TextView tv_serial;
@BindView
public TextView tv_version;
@BindView
public LinearLayout user_icon;
@BindView
public LinearLayout user_icon_settings;
public class a implements DialogInterface.OnClickListener {
public final String f5005n;
public a(String str) {
this.f5005n = str;
}
@Override
public final void onClick(DialogInterface dialogInterface, int i10) {
dialogInterface.dismiss();
if (this.f5005n.equalsIgnoreCase("en")) {
SettingsFragment settingsFragment = SettingsFragment.this;
int i11 = SettingsFragment.f4998q0;
settingsFragment.f8208h0.O("en");
SettingsFragment.y0(SettingsFragment.this, "en");
return;
}
SettingsFragment settingsFragment2 = SettingsFragment.this;
int i12 = SettingsFragment.f4998q0;
settingsFragment2.f8208h0.O("ar");
SettingsFragment.y0(SettingsFragment.this, "ar");
}
}
public class b implements DialogInterface.OnClickListener {
public final String f5007n;
public b(String str) {
this.f5007n = str;
}
@Override
public final void onClick(DialogInterface dialogInterface, int i10) {
dialogInterface.dismiss();
if (this.f5007n.equalsIgnoreCase("en")) {
SettingsFragment.this.rdbn_arabic.setChecked(true);
} else {
SettingsFragment.this.rdbn_english.setChecked(true);
}
}
}
public class c implements CompoundButton.OnCheckedChangeListener {
public c() {
}
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
if (z) {
SettingsFragment settingsFragment = SettingsFragment.this;
int i10 = SettingsFragment.f4998q0;
s.c(settingsFragment.f8208h0.f8724a, "is_notif_on", true);
if (TextUtils.isEmpty(SettingsFragment.this.f5003o0)) {
return;
}
SettingsFragment settingsFragment2 = SettingsFragment.this;
SettingsFragment.A0(settingsFragment2, settingsFragment2.f5003o0, true);
return;
}
SettingsFragment settingsFragment3 = SettingsFragment.this;
int i11 = SettingsFragment.f4998q0;
s.c(settingsFragment3.f8208h0.f8724a, "is_notif_on", false);
if (TextUtils.isEmpty(SettingsFragment.this.f5003o0)) {
return;
}
SettingsFragment settingsFragment4 = SettingsFragment.this;
SettingsFragment.A0(settingsFragment4, settingsFragment4.f5003o0, false);
}
}
public class d implements f {
public d() {
}
@Override
public final void d(View view, int i10) {
if (i10 == 0) {
SettingsFragment.this.drawer_layout.d();
SettingsFragment.this.p0().t(ServicesFragmentNewUI.D0(null, false));
return;
}
if (i10 == 1) {
SettingsFragment settingsFragment = SettingsFragment.this;
int i11 = SettingsFragment.f4998q0;
settingsFragment.p0().t(new BookAppointmentLaunchFragment());
SettingsFragment.this.drawer_layout.d();
return;
}
if (i10 == 2) {
SettingsFragment settingsFragment2 = SettingsFragment.this;
int i12 = SettingsFragment.f4998q0;
settingsFragment2.p0().t(SupportFragmentNewUI.y0());
SettingsFragment.this.drawer_layout.d();
return;
}
if (i10 != 3) {
return;
}
SettingsFragment settingsFragment3 = SettingsFragment.this;
int i13 = SettingsFragment.f4998q0;
if (settingsFragment3.f8208h0.k() == null) {
m.o("", SettingsFragment.this.p0());
SettingsFragment.this.drawer_layout.d();
} else {
m.o("con", SettingsFragment.this.p0());
SettingsFragment.this.drawer_layout.d();
}
}
}
public class e implements Callback<wd.a> {
@Override
public final void onFailure(Call<wd.a> call, Throwable th) {
}
@Override
public final void onResponse(Call<wd.a> call, Response<wd.a> response) {
}
}
public static void A0(SettingsFragment settingsFragment, String str, boolean z) {
String str2;
String str3;
String str4;
if (!z) {
s.c(settingsFragment.f8208h0.f8724a, "is_notif_on", false);
settingsFragment.D0("0");
return;
}
settingsFragment.getClass();
if (!str.equalsIgnoreCase("con")) {
if (str.equalsIgnoreCase(" ")) {
settingsFragment.D0(settingsFragment.r0().z());
return;
}
return;
}
settingsFragment.f8208h0.k();
String z10 = settingsFragment.r0().z();
String str5 = null;
try {
str2 = Build.VERSION.RELEASE;
} catch (Throwable unused) {
str2 = null;
}
if (str2 != null) {
try {
str5 = Build.VERSION.RELEASE;
} catch (Throwable unused2) {
}
str3 = str5;
} else {
str3 = "Not found";
}
try {
} catch (Exception e10) {
e10.printStackTrace();
}
if (r.c() != null) {
str4 = r.c();
WebServiceFactoryV2.c(new com.qa.kahramaa.kahramaa.base.retrofit.c(com.qa.kahramaa.kahramaa.base.retrofit.d.a().f3469d, 0)).l1(new zb.d("", "", z10, settingsFragment.f5004p0, settingsFragment.f8208h0.f(), str3, str4)).enqueue(new h(settingsFragment.p0(), new r5.a()));
}
str4 = "Not found";
WebServiceFactoryV2.c(new com.qa.kahramaa.kahramaa.base.retrofit.c(com.qa.kahramaa.kahramaa.base.retrofit.d.a().f3469d, 0)).l1(new zb.d("", "", z10, settingsFragment.f5004p0, settingsFragment.f8208h0.f(), str3, str4)).enqueue(new h(settingsFragment.p0(), new r5.a()));
}
public static SettingsFragment B0(String str) {
SettingsFragment settingsFragment = new SettingsFragment();
Bundle bundle = new Bundle();
bundle.putString("USER", str);
settingsFragment.k0(bundle);
return settingsFragment;
}
public static void y0(SettingsFragment settingsFragment, String str) {
settingsFragment.f8208h0.O(str);
if (settingsFragment.r0() != null) {
settingsFragment.r0().finish();
settingsFragment.o0(new Intent(settingsFragment.p0(), (Class<?>) MainActivity.class));
}
}
public static void z0(SettingsFragment settingsFragment) {
String str;
String str2;
boolean z;
settingsFragment.getClass();
WebServiceFactoryV2.d(new com.qa.kahramaa.kahramaa.base.retrofit.c()).f0(new zb.f(x.A(new ArrayList(Arrays.asList("SessionId", "CustomerNumber", "SerialNumber")), new ArrayList(Arrays.asList(settingsFragment.f8208h0.x(), String.valueOf(settingsFragment.f8208h0.k().f11801s.a()), settingsFragment.f8208h0.e())), WebServiceFactoryV2.getDashboardEnc(), WebServiceFactoryV2.getDashboardEncIv()))).enqueue(new h(settingsFragment.p0(), new e0()));
if (settingsFragment.r0() != null) {
if (Build.VERSION.SDK_INT >= 25 && settingsFragment.f8208h0.k() != null && settingsFragment.f8208h0.k().f11801s != null) {
ArrayList a10 = settingsFragment.f5000l0.a();
ArrayList arrayList = new ArrayList();
int i10 = 0;
while (true) {
if (i10 >= a10.size()) {
z = false;
break;
} else {
if ("bills".equalsIgnoreCase(((ShortcutInfo) a10.get(i10)).getId())) {
arrayList.add(((ShortcutInfo) a10.get(i10)).getId());
z = true;
break;
}
i10++;
}
}
if (z) {
settingsFragment.f5000l0.f8756b.removeDynamicShortcuts(arrayList);
}
}
ob.c.d(settingsFragment.f8208h0);
settingsFragment.f8208h0.J("EMPLOYEE");
settingsFragment.p0().v(0);
settingsFragment.r0().finish();
settingsFragment.o0(new Intent(settingsFragment.p0(), (Class<?>) MainActivity.class));
}
String str3 = null;
try {
str = Build.VERSION.RELEASE;
} catch (Throwable unused) {
str = null;
}
String str4 = "Not found";
if (str != null) {
try {
str3 = Build.VERSION.RELEASE;
} catch (Throwable unused2) {
}
str2 = str3;
} else {
str2 = "Not found";
}
try {
if (r.c() != null) {
str4 = r.c();
}
} catch (Exception e10) {
e10.printStackTrace();
}
WebServiceFactoryV2.c(new com.qa.kahramaa.kahramaa.base.retrofit.c(com.qa.kahramaa.kahramaa.base.retrofit.d.a().f3469d, 0)).l1(new zb.d("", "", settingsFragment.f8208h0.t(), settingsFragment.f8208h0.g(), settingsFragment.f8208h0.f(), str2, str4)).enqueue(new h(settingsFragment.p0(), new g0()));
}
public final void C0(String str) {
String z = z(2131690123);
String z10 = z(2131689597);
AlertDialog.Builder builder = new AlertDialog.Builder(p0(), 2131755229);
builder.setTitle(z(2131690418));
builder.setMessage(2131689609);
builder.setPositiveButton(z, new a(str));
builder.setNegativeButton(z10, new b(str));
AlertDialog create = builder.create();
create.setCanceledOnTouchOutside(false);
create.show();
}
public final void D0(String str) {
String str2;
String str3;
String str4 = null;
try {
str2 = Build.VERSION.RELEASE;
} catch (Throwable unused) {
str2 = null;
}
String str5 = "Not found";
if (str2 != null) {
try {
str4 = Build.VERSION.RELEASE;
} catch (Throwable unused2) {
}
str3 = str4;
} else {
str3 = "Not found";
}
try {
if (r.c() != null) {
str5 = r.c();
}
} catch (Exception e10) {
e10.printStackTrace();
}
WebServiceFactoryV2.c(new com.qa.kahramaa.kahramaa.base.retrofit.c(com.qa.kahramaa.kahramaa.base.retrofit.d.a().f3469d, 0)).l1(new zb.d("", "", str, this.f5004p0, this.f8208h0.f(), str3, str5)).enqueue(new h(p0(), new e()));
}
@Override
public final View J(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
return layoutInflater.inflate(2131493144, (ViewGroup) null);
}
@Override
public final void R(int i10, String[] strArr, int[] iArr) {
if (i10 != 100) {
if (i10 != 112) {
return;
}
if (iArr.length > 0 && iArr[0] == 0) {
o0(new Intent("android.intent.action.CALL", Uri.parse("tel:991")));
return;
} else {
if (p0() == null || !C()) {
return;
}
w.h(this.coordinatorLayout, w().getString(2131690545), 0, new int[0]);
return;
}
}
if (iArr.length <= 0 || iArr[0] != 0) {
if (p0() == null || !C()) {
return;
}
w.h(this.coordinatorLayout, w().getString(2131690545), 0, new int[0]);
return;
}
ArrayList<ContentProviderOperation> arrayList = new ArrayList<>();
this.f4999k0 = arrayList;
arrayList.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI).withValue("account_type", null).withValue("account_name", null).build());
this.f4999k0.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI).withValueBackReference("raw_contact_id", 0).withValue("mimetype", "vnd.android.cursor.item/name").withValue("data1", "Kahramaa").build());
this.f4999k0.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI).withValueBackReference("raw_contact_id", 0).withValue("mimetype", "vnd.android.cursor.item/email_v2").withValue("data1", "[email protected]").withValue("data2", 2).build());
this.f4999k0.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI).withValueBackReference("raw_contact_id", 0).withValue("mimetype", "vnd.android.cursor.item/phone_v2").withValue("data1", "+97430303991").withValue("data2", 3).build());
this.f4999k0.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI).withValueBackReference("raw_contact_id", 0).withValue("mimetype", "vnd.android.cursor.item/organization").withValue("data1", "Kahramaa").withValue("data2", 1).withValue("data2", 1).build());
try {
String string = w().getString(2131690493);
String string2 = w().getString(2131689597);
String string3 = w().getString(2131690130);
p0();
xd.d dVar = new xd.d(this);
b.a aVar = new b.a(p0(), 2131755016);
aVar.f955a.f = string;
aVar.f(string3, dVar);
aVar.d(string2, dVar);
aVar.h();
p0().getContentResolver().applyBatch("com.android.contacts", this.f4999k0);
} catch (Exception e10) {
e10.printStackTrace();
if (p0() == null || !C()) {
return;
}
w.h(this.coordinatorLayout, w().getString(2131690545), 0, new int[0]);
}
}
@Override
public final void S() {
this.R = true;
this.f5002n0.f10637r = new d();
}
@Override
@TargetApi(16)
public final void W(View view, Bundle bundle) {
String e10;
String str;
super.W(view, bundle);
this.f5003o0 = this.f1673t.getString("USER");
s0().setTitleBarBackgroundColor(0);
s0().c();
q0().c();
s0().setSubHeading(w().getString(2131690417));
s0().a();
s0().b();
s0().d();
if (this.f8208h0.g().equalsIgnoreCase("ar")) {
this.iv_notification.setImageResource(2131231023);
} else {
this.iv_notification.setImageResource(2131230833);
}
if (Build.VERSION.SDK_INT >= 25) {
this.f5000l0 = new v(p0());
}
this.tv_version.setText(String.valueOf(this.f8208h0.f()));
if (this.f8208h0.g().equalsIgnoreCase("en")) {
this.logout_arrow.setBackgroundResource(2131230817);
this.app_arrow.setBackgroundResource(2131230817);
this.tnc_arrow.setBackgroundResource(2131230817);
} else {
this.logout_arrow.setBackgroundResource(2131230818);
this.app_arrow.setBackgroundResource(2131230818);
this.tnc_arrow.setBackgroundResource(2131230818);
}
this.tv_serial.setText(this.f8208h0.e());
if (this.f5003o0.equalsIgnoreCase("con")) {
this.ll_app_lock.setVisibility(0);
} else if (this.f5003o0.equalsIgnoreCase("emp")) {
this.ll_app_lock.setVisibility(8);
} else if (this.f5003o0.trim().equalsIgnoreCase("")) {
this.ll_app_lock.setVisibility(8);
}
int i10 = 1;
try {
if (this.f5003o0.equalsIgnoreCase("emp")) {
this.ll_logout.setVisibility(0);
s0().setTitleBarBackgroundColor(w().getColor(2131099787));
} else if (this.f5003o0.equalsIgnoreCase("con")) {
this.ll_logout.setVisibility(0);
s0().setTitleBarBackgroundColor(0);
if (this.f8208h0.g().equalsIgnoreCase("en")) {
e10 = this.f8208h0.k().f11801s.f();
this.language_data.setText(z(2131689778));
} else {
e10 = this.f8208h0.k().f11801s.e();
this.language_data.setText(z(2131689548));
}
if (e10.split("\\w+").length > 1) {
str = e10.substring(e10.lastIndexOf(" ") + 1);
e10 = e10.substring(0, e10.lastIndexOf(" "));
} else {
str = "";
}
if (str.equalsIgnoreCase("")) {
this.nav_userShortName.setText(e10.substring(0, 1));
this.short_name.setText(e10.substring(0, 1));
} else {
this.nav_userShortName.setText(e10.substring(0, 1) + str.substring(0, 1));
this.short_name.setText(e10.substring(0, 1) + str.substring(0, 1));
}
if (this.f8208h0.g().equalsIgnoreCase("en")) {
this.nav_userQid.setText(String.valueOf(this.f8208h0.k().f11801s.a()));
this.nav_userName.setText(this.f8208h0.k().f11801s.f());
} else {
this.nav_userQid.setText(String.valueOf(this.f8208h0.k().f11801s.a()));
this.nav_userName.setText(this.f8208h0.k().f11801s.e());
}
this.nav_Qid_text.setVisibility(0);
} else if (this.f5003o0.equalsIgnoreCase("")) {
this.user_icon_settings.setVisibility(8);
this.ll_logout.setVisibility(8);
this.ll_my_profile.setVisibility(8);
this.user_icon.setVisibility(8);
this.nav_userName.setVisibility(8);
this.nav_userQid.setVisibility(8);
s0().setTitleBarBackgroundColor(0);
}
} catch (Exception e11) {
e11.printStackTrace();
}
if (this.f8208h0.g().isEmpty()) {
if (Locale.getDefault().getDisplayLanguage().equalsIgnoreCase("English")) {
this.f5004p0 = "en";
} else {
this.f5004p0 = "ar";
}
} else if (this.f8208h0.g().equalsIgnoreCase("en")) {
this.f5004p0 = "en";
} else {
this.f5004p0 = "ar";
}
ArrayList arrayList = new ArrayList();
this.f5001m0 = arrayList;
arrayList.add(new oc.d(z(2131690411), 2131231172));
this.f5001m0.add(new oc.d(z(2131690386), 2131231057));
this.f5001m0.add(new oc.d(z(2131689890), 2131231123));
this.f5001m0.add(new oc.d(z(2131690419), 2131231174));
this.f5001m0 = this.f5001m0;
p0();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(1);
this.lst_menu_items.setHasFixedSize(true);
this.lst_menu_items.setLayoutManager(linearLayoutManager);
mc.d dVar = new mc.d(p0(), this.f5001m0);
this.f5002n0 = dVar;
this.lst_menu_items.setAdapter(dVar);
this.nav_serial_number.setText(this.f8208h0.e());
this.nav_version_number.setText(String.valueOf(this.f8208h0.f()));
if (s.a(this.f8208h0.f8724a).getBoolean("is_notif_on", false)) {
this.notification_switch.setChecked(true);
} else {
this.notification_switch.setChecked(false);
}
this.notification_switch.setOnCheckedChangeListener(new c());
this.rdbn_english.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
SettingsFragment settingsFragment = SettingsFragment.this;
settingsFragment.rdbn_english.setChecked(true);
settingsFragment.C0("en");
}
});
this.rdbn_arabic.setOnClickListener(new ub.s(this, i10));
if (this.f8208h0.g().equalsIgnoreCase("en")) {
this.rdbn_english.setChecked(true);
} else {
this.rdbn_arabic.setChecked(true);
}
}
@Override
@TargetApi(16)
public final void onClick(View view) {
switch (view.getId()) {
case 2131296511:
if (this.drawer_layout.m()) {
this.drawer_layout.d();
break;
}
break;
case 2131296967:
String string = w().getString(2131689595);
String string2 = w().getString(2131689597);
String string3 = w().getString(2131689593);
p0();
b.a aVar = new b.a(p0(), 2131755229);
String z = z(2131689543);
AlertController.b bVar = aVar.f955a;
bVar.f939d = z;
bVar.f = string;
aVar.f(string3, new xd.e(this));
aVar.d(string2, new xd.f());
androidx.appcompat.app.b a10 = aVar.a();
a10.setCanceledOnTouchOutside(false);
a10.show();
break;
case 2131297004:
this.F.N();
break;
case 2131297053:
bb.a p02 = p0();
new FingerPrintSettings();
p02.t(new FingerPrintSettings());
break;
case 2131297134:
b.a aVar2 = new b.a(p0(), 2131755229);
String z10 = z(2131690123);
String z11 = z(2131689597);
aVar2.f955a.f939d = z(2131690418);
aVar2.b(2131689550);
aVar2.f(z10, new xd.b(this));
aVar2.d(z11, new xd.c());
androidx.appcompat.app.b a11 = aVar2.a();
a11.setCanceledOnTouchOutside(false);
a11.show();
break;
case 2131297169:
if (!this.f8208h0.g().equalsIgnoreCase("ar")) {
bb.a p03 = p0();
new LinkFragment();
p03.t(LinkFragment.y0("https://kiosk.km.qa/terms/en.html"));
break;
} else {
bb.a p04 = p0();
new LinkFragment();
p04.t(LinkFragment.y0("https://kiosk.km.qa/terms/"));
break;
}
}
}
@Override
public final void w0() {
this.ll_logout.setOnClickListener(this);
this.ll_terms.setOnClickListener(this);
this.ll_app_lock.setOnClickListener(this);
this.ll_language.setOnClickListener(this);
this.close_button.setOnClickListener(this);
this.iv_notification.setOnClickListener(this);
}
}