正在查看: 050 IP Phone v2.3.0 应用的 OtherSettingActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 050 IP Phone v2.3.0 应用的 OtherSettingActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.ntt.voip.android.com050plus.setting;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.preference.CheckBoxPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceManager;
import com.oki_access.android.ims.call.BasePreferenceActivity;
import com.oki_access.android.util.SecureListPreference;
import d4.f;
import d4.g;
import k4.d;
import k4.s;
import o4.e;
import t4.p;
import t4.z;
public class OtherSettingActivity extends BasePreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
private e X;
private s Y;
class a implements Preference.OnPreferenceClickListener {
a() {
}
public boolean onPreferenceClick(Preference preference) {
p.s(OtherSettingActivity.this, 100, null);
return true;
}
}
class b implements DialogInterface.OnClickListener {
b() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
OtherSettingActivity.this.h0();
}
}
private void V(String str) {
PreferenceCategory R = R(str);
if (R != null) {
R.setVisible(false);
}
}
protected static boolean W(Boolean[] boolArr) {
boolean z = false;
for (Boolean bool : boolArr) {
if (bool.booleanValue()) {
z = true;
}
}
return z;
}
public static void X(Context context) {
z.a("OtherSettingActivity", "checkValidServiceSettings");
if (context == null) {
return;
}
Y(context, e0(context));
}
private static void Y(Context context, Object[][] objArr) {
e eVar = new e(context);
if (objArr != null) {
for (Object[] objArr2 : objArr) {
if (objArr2 != null && objArr2.length == 3) {
Object obj = objArr2[0];
String str = obj instanceof String ? (String) obj : null;
Object obj2 = objArr2[1];
int intValue = obj2 instanceof Integer ? ((Integer) obj2).intValue() : 0;
Object obj3 = objArr2[2];
String[] strArr = obj3 != null ? (String[]) obj3 : null;
if (str != null && intValue > 0 && strArr != null) {
int l = eVar.l(str, intValue);
if (!a0(String.valueOf(l), strArr)) {
z.p("OtherSettingActivity", "Invalid value for key=[" + d.n(str, intValue) + "], value =[" + l + "]");
int f = eVar.f(str, intValue);
if (a0(String.valueOf(f), strArr)) {
eVar.u(str, intValue);
} else {
z.p("OtherSettingActivity", "Invalid default value for key=[" + d.n(str, intValue) + "], value =[" + f + "]");
eVar.x(str, intValue, Integer.parseInt(strArr[0]));
}
if ("spitz.call".equals(str)) {
h4.d.i0(intValue, eVar.l(str, intValue));
}
d.w(context, str, intValue);
if ("spitz.call".equals(str) && 1114174 == intValue) {
j0(context, eVar);
}
}
}
}
}
}
}
public static void Z(Context context) {
z.a("OtherSettingActivity", "checkValidUISettings");
if (context == null) {
return;
}
Y(context, g0(context));
}
private static boolean a0(String str, String[] strArr) {
if (strArr == null) {
return false;
}
for (String str2 : strArr) {
if (str2 != null && str2.equals(str)) {
return true;
}
}
return false;
}
protected static Boolean[] b0(Context context) {
return new Boolean[]{c0(context, com.oki_access.android.ims.call.d.e.E6()), c0(context, com.oki_access.android.ims.call.d.e.B6()), c0(context, com.oki_access.android.ims.call.d.e.F6()), c0(context, com.oki_access.android.ims.call.d.e.C6()), c0(context, com.oki_access.android.ims.call.d.e.D6()), c0(context, com.oki_access.android.ims.call.d.e.A6())};
}
private static Boolean c0(Context context, int i) {
return Boolean.valueOf(s.c(context, i));
}
protected static Boolean[] d0(Context context) {
return new Boolean[]{c0(context, com.oki_access.android.ims.call.d.e.I6()), c0(context, com.oki_access.android.ims.call.d.e.G6())};
}
private static Object[][] e0(Context context) {
return new Object[][]{new Object[]{"framework", 65567, context.getResources().getStringArray(2130903136)}, new Object[]{"framework.core", 65554, context.getResources().getStringArray(2130903129)}};
}
private static Object[][] f0(Context context) {
return new Object[][]{new Object[]{"framework", 65567, context.getResources().getStringArray(2130903136)}, new Object[]{"framework.core", 65554, context.getResources().getStringArray(2130903129)}, new Object[]{"spitz.call", 1114171, context.getResources().getStringArray(2130903123)}, new Object[]{"spitz.call", 1114170, context.getResources().getStringArray(2130903116)}, new Object[]{g.d, Integer.valueOf(f.A4), context.getResources().getStringArray(2130903116)}, new Object[]{"spitz.call", 1114173, context.getResources().getStringArray(2130903118)}, new Object[]{"spitz.call", 1114172, context.getResources().getStringArray(2130903125)}, new Object[]{"spitz.call", 1114175, null}, new Object[]{"spitz.call", 1114174, context.getResources().getStringArray(2130903114)}};
}
private static Object[][] g0(Context context) {
return new Object[][]{new Object[]{"spitz.call", 1114171, context.getResources().getStringArray(2130903123)}, new Object[]{"spitz.call", 1114170, context.getResources().getStringArray(2130903116)}, new Object[]{g.d, Integer.valueOf(f.A4), context.getResources().getStringArray(2130903116)}, new Object[]{"spitz.call", 1114173, context.getResources().getStringArray(2130903118)}, new Object[]{"spitz.call", 1114172, context.getResources().getStringArray(2130903125)}, new Object[]{"spitz.call", 1114175, null}, new Object[]{"spitz.call", 1114174, context.getResources().getStringArray(2130903114)}, new Object[]{"spitz.call", 1114176, context.getResources().getStringArray(2130903120)}, new Object[]{"spitz.call", 1114177, context.getResources().getStringArray(2130903119)}, new Object[]{"spitz.call", 1114178, context.getResources().getStringArray(2130903121)}, new Object[]{"spitz.call", 65583, context.getResources().getStringArray(2130903134)}, new Object[]{"spitz.call", 65584, context.getResources().getStringArray(2130903133)}};
}
public void h0() {
z.a("OtherSettingActivity", "initSettings");
Object[][] f0 = f0(this);
if (f0 != null) {
for (Object[] objArr : f0) {
if (objArr != null && objArr.length == 3) {
Object obj = objArr[0];
String str = obj instanceof String ? (String) obj : null;
Object obj2 = objArr[1];
int intValue = obj2 instanceof Integer ? ((Integer) obj2).intValue() : 0;
Object obj3 = objArr[2];
String[] strArr = obj3 != null ? (String[]) obj3 : null;
if (str != null && intValue > 0) {
int f = this.X.f(str, intValue);
if (strArr == null || a0(String.valueOf(f), strArr)) {
this.X.u(str, intValue);
} else {
z.p("OtherSettingActivity", "Invalid default value for key=[" + d.n(str, intValue) + "], value =[" + f + "]");
this.X.x(str, intValue, Integer.parseInt(strArr[0]));
}
if ("spitz.call".equals(str)) {
h4.d.i0(intValue, this.X.l(str, intValue));
}
d.w(this, str, intValue);
}
}
}
}
j0(this, this.X);
l0();
}
private void i0() {
Boolean[] d0 = d0(this);
Boolean[] b0 = b0(this);
if (W(d0)) {
p0(d0[0], "pref_category_sip_setting", "pref_sip_ip_header_tos");
p0(d0[1], "pref_category_sip_setting", "pref_invite_wait_timer");
} else {
V("pref_category_sip_setting");
}
if (!W(b0)) {
V("pref_category_audio_setting");
return;
}
p0(b0[0], "pref_category_audio_setting", "pref_esound_sampling_rate");
p0(b0[1], "pref_category_audio_setting", "pref_esound_ip_precedence");
p0(b0[2], "pref_category_audio_setting", "pref_esound_spk_channel");
p0(b0[3], "pref_category_audio_setting", "pref_esound_mic_channel");
p0(b0[4], "pref_category_audio_setting", "pref_esound_noise_reduction");
p0(b0[5], "pref_category_audio_setting", "pref_esound_dtmf_duration");
}
private static void j0(Context context, e eVar) {
z.a("OtherSettingActivity", "refreshDTMFIntervals");
int l = eVar.l("spitz.call", 1114174);
int parseInt = Integer.parseInt(com.oki_access.android.ims.settings.c.h(context.getString(2131887551))) + l;
String str = g.d;
eVar.x(str, f.B4, parseInt);
d.w(context, str, f.B4);
eVar.x(str, f.C4, l + Integer.parseInt(com.oki_access.android.ims.settings.c.h(context.getString(2131887549))));
d.w(context, str, f.C4);
}
private void k0(SharedPreferences sharedPreferences, String str, boolean z) {
if ("pref_sip_ip_header_tos".equals(str)) {
m0("pref_sip_ip_header_tos", "framework", 65567, z);
return;
}
if ("pref_invite_wait_timer".equals(str)) {
m0("pref_invite_wait_timer", "framework.core", 65554, z);
return;
}
if ("pref_esound_sampling_rate".equals(str)) {
n0("pref_esound_sampling_rate", 1114171, z);
return;
}
if ("pref_esound_ip_precedence".equals(str)) {
n0("pref_esound_ip_precedence", 1114170, z);
if (z) {
int k = this.Y.k(1114170);
e eVar = this.X;
String str2 = g.d;
eVar.x(str2, f.A4, k);
d.w(this, str2, f.A4);
return;
}
return;
}
if ("pref_esound_spk_channel".equals(str)) {
n0("pref_esound_spk_channel", 1114172, z);
return;
}
if ("pref_esound_mic_channel".equals(str)) {
n0("pref_esound_mic_channel", 1114173, z);
return;
}
if ("pref_esound_noise_reduction".equals(str)) {
o0("pref_esound_noise_reduction", 1114175, z);
} else if ("pref_esound_dtmf_duration".equals(str)) {
n0("pref_esound_dtmf_duration", 1114174, z);
if (z) {
j0(this, this.X);
}
}
}
private void l0() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
k0(defaultSharedPreferences, "pref_sip_ip_header_tos", false);
k0(defaultSharedPreferences, "pref_invite_wait_timer", false);
k0(defaultSharedPreferences, "pref_esound_sampling_rate", false);
k0(defaultSharedPreferences, "pref_esound_ip_precedence", false);
k0(defaultSharedPreferences, "pref_esound_spk_channel", false);
k0(defaultSharedPreferences, "pref_esound_mic_channel", false);
k0(defaultSharedPreferences, "pref_esound_noise_reduction", false);
k0(defaultSharedPreferences, "pref_esound_dtmf_duration", false);
}
private int m0(String str, String str2, int i, boolean z) {
SecureListPreference R = R(str);
if (R == null) {
return -1;
}
if (!z) {
R.d(Integer.toString(this.X.l(str2, i)));
}
this.X.f(str2, i);
int intValue = Integer.valueOf(R.c()).intValue();
if (R.getEntry() != null) {
R.setSummary(R.getEntry().toString());
}
if (!z) {
return intValue;
}
this.X.x(str2, i, intValue);
d.w(this, str2, i);
return intValue;
}
private int n0(String str, int i, boolean z) {
SecureListPreference R = R(str);
if (R == null) {
return -1;
}
if (!z) {
R.d(Integer.toString(this.Y.k(i)));
}
this.Y.f(i);
int intValue = Integer.valueOf(R.c()).intValue();
if (R.getEntry() != null) {
R.setSummary(R.getEntry().toString());
}
if (!z) {
return intValue;
}
this.Y.w(i, intValue);
h4.d.i0(i, intValue);
d.w(this, "spitz.call", i);
return intValue;
}
private int o0(String str, int i, boolean z) {
CheckBoxPreference R = R(str);
if (R == null) {
return -1;
}
if (!z) {
R.setChecked(this.Y.k(i) != 0);
}
int i8 = R.isChecked() ? 2 : 0;
this.Y.f(i);
String.valueOf(R.isChecked());
if (!z) {
return i8;
}
this.Y.w(i, i8);
h4.d.i0(i, i8);
d.w(this, "spitz.call", i);
return i8;
}
private void p0(Boolean bool, String str, String str2) {
if (bool.booleanValue() || R(str) == null) {
return;
}
R(str2).setVisible(false);
}
@Override
public void e() {
Preference R = R("pref_other_init");
if (R != null) {
R.setOnPreferenceClickListener(new a());
}
i0();
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.X = new e(this);
this.Y = new s(this, "spitz.call", 2);
T(2132082717);
}
@Override
public void onPause() {
z.a("OtherSettingActivity", "onPause");
super.onPause();
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);
if (isFinishing()) {
c4.c.f(this);
}
}
@Override
public void onResume() {
z.a("OtherSettingActivity", "onResume");
super.onResume();
l0();
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String str) {
z.a("OtherSettingActivity", "onSharedPreferenceChanged; key=[" + str + "]");
k0(sharedPreferences, str, true);
}
@Override
public Dialog y(int i, Bundle bundle, p pVar) {
return 100 == i ? new AlertDialog.Builder(this).setMessage(2131888491).setPositiveButton(com.oki_access.android.ims.call.d.e.H1(), new b()).setNegativeButton(com.oki_access.android.ims.call.d.e.E1(), (DialogInterface.OnClickListener) null).create() : super.y(i, bundle, pVar);
}
}