正在查看: Petal Maps v4.7.0.310001 应用的 SecureIntentUtil.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Petal Maps v4.7.0.310001 应用的 SecureIntentUtil.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.huawei.hiassistant.platform.base.util;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import com.huawei.hiassistant.platform.base.util.SecureIntentUtil;
import java.util.ArrayList;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Predicate;
public class SecureIntentUtil {
private static final String TAG = "SecureIntentUtil";
private SecureIntentUtil() {
}
public static Bundle getSecureBundle(Bundle bundle, String str) {
if (bundle != null) {
try {
return bundle.getBundle(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBundle is error");
}
}
return null;
}
public static ArrayList<String> getSecureBundleArrayList(Bundle bundle, String str) {
ArrayList<String> arrayList = new ArrayList<>();
if (bundle == null) {
return arrayList;
}
try {
return bundle.getStringArrayList(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBundleExtra is error");
return arrayList;
}
}
public static boolean getSecureBundleBoolean(Bundle bundle, String str, boolean z) {
if (bundle == null) {
return z;
}
try {
return bundle.getBoolean(str, z);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBoolean is error");
return z;
}
}
public static int getSecureBundleInt(Bundle bundle, String str, int i) {
if (bundle == null) {
return i;
}
try {
return bundle.getInt(str, i);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBundleExtra is error");
return i;
}
}
public static Object getSecureBundleObject(Bundle bundle, String str) {
if (bundle != null) {
try {
return bundle.get(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "get is error");
}
}
return null;
}
public static <T> T getSecureBundleParcelable(Bundle bundle, String str, Class<T> cls) {
Parcelable parcelable;
if (bundle != null) {
try {
parcelable = bundle.getParcelable(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getParcelable error.");
}
if (parcelable == null && cls != null && cls.isInstance(parcelable)) {
return cls.cast(parcelable);
}
return null;
}
parcelable = null;
if (parcelable == null) {
}
return null;
}
public static Object getSecureBundleSerializable(Bundle bundle, String str) {
if (bundle != null) {
try {
return bundle.getSerializable(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getSerializable is error");
}
}
return null;
}
public static short getSecureBundleShort(Bundle bundle, String str, short s) {
if (bundle == null) {
return s;
}
try {
return bundle.getShort(str, s);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getShort is error");
return s;
}
}
public static String getSecureBundleString(Bundle bundle, String str, String str2) {
if (bundle == null) {
return str2;
}
try {
return bundle.getString(str, str2);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBundleExtra is error");
return str2;
}
}
public static String[] getSecureBundleStringArray(Bundle bundle, String str, String[] strArr) {
if (bundle == null) {
return strArr;
}
try {
return bundle.getStringArray(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBundleExtra is error");
return strArr;
}
}
public static boolean getSecureIntentBoolean(Intent intent, String str, boolean z) {
if (intent == null) {
return z;
}
try {
return intent.getBooleanExtra(str, z);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBooleanExtra error");
return z;
}
}
public static android.os.Bundle getSecureIntentExtras(android.content.Intent r0, java.lang.String r1) {
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hiassistant.platform.base.util.SecureIntentUtil.getSecureIntentExtras(android.content.Intent, java.lang.String):android.os.Bundle");
}
public static int getSecureIntentInt(Intent intent, String str, int i) {
if (intent == null) {
return i;
}
try {
return intent.getIntExtra(str, i);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getIntExtra error");
return i;
}
}
public static int[] getSecureIntentIntArray(Intent intent, String str) {
if (intent != null) {
try {
return intent.getIntArrayExtra(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getBooleanExtra error");
}
}
return null;
}
public static long getSecureIntentLong(Intent intent, String str, long j) {
if (intent == null) {
return j;
}
try {
return intent.getLongExtra(str, j);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getLongExtra error");
return j;
}
}
public static <T> T getSecureIntentParcelable(Intent intent, String str, Class<T> cls) {
Parcelable parcelableExtra;
if (intent != null) {
try {
parcelableExtra = intent.getParcelableExtra(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getParcelableExtra error.");
}
if (parcelableExtra == null && cls != null && cls.isInstance(parcelableExtra)) {
return cls.cast(parcelableExtra);
}
return null;
}
parcelableExtra = null;
if (parcelableExtra == null) {
}
return null;
}
public static ArrayList getSecureIntentParcelableArrayList(Intent intent, String str) {
if (intent != null) {
try {
return intent.getParcelableArrayListExtra(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getParcelableExtra error.");
}
}
return null;
}
public static String getSecureIntentString(Intent intent, String str) {
if (intent != null) {
try {
return intent.getStringExtra(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getStringExtra error");
}
}
return "";
}
public static String[] getSecureIntentStringArray(Intent intent, String str) {
String[] strArr = new String[0];
if (intent == null) {
return strArr;
}
try {
return intent.getStringArrayExtra(str);
} catch (RuntimeException unused) {
KitLog.error(TAG, "getStringExtra is error");
return strArr;
}
}
public static boolean lambda$transferBooleanExtra$2(String str, Intent intent) {
return intent.hasExtra(str);
}
public static void lambda$transferBooleanExtra$3(String str, boolean z, Intent intent, Intent intent2) {
boolean secureBundleBoolean = getSecureBundleBoolean(intent2.getExtras(), str, z);
intent.putExtra(str, secureBundleBoolean);
KitLog.debug(TAG, "transferBooleanExtra {} -> {}", str, Boolean.valueOf(secureBundleBoolean));
}
public static boolean lambda$transferIntExtra$0(String str, Intent intent) {
return intent.hasExtra(str);
}
public static void lambda$transferIntExtra$1(Intent intent, String str, Intent intent2, Intent intent3) {
int secureBundleInt = getSecureBundleInt(intent.getExtras(), str, Integer.MAX_VALUE);
if (secureBundleInt != Integer.MAX_VALUE) {
intent2.putExtra(str, secureBundleInt);
}
KitLog.debug(TAG, "transferIntExtra {} -> {}", str, Integer.valueOf(secureBundleInt));
}
public static boolean lambda$transferStringExtra$4(String str, Intent intent) {
return intent.hasExtra(str);
}
public static void lambda$transferStringExtra$5(Intent intent, String str, Intent intent2, Intent intent3) {
String secureIntentString = getSecureIntentString(intent, str);
if (TextUtils.isEmpty(secureIntentString)) {
return;
}
intent2.putExtra(str, secureIntentString);
KitLog.debug(TAG, "transferStringExtra {} -> {}", str, secureIntentString);
}
public static void transferBooleanExtra(Intent intent, final Intent intent2, final String str, final boolean z) {
Optional.ofNullable(intent).filter(new Predicate() {
@Override
public final boolean test(Object obj) {
boolean lambda$transferBooleanExtra$2;
lambda$transferBooleanExtra$2 = SecureIntentUtil.lambda$transferBooleanExtra$2(str, (Intent) obj);
return lambda$transferBooleanExtra$2;
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
SecureIntentUtil.lambda$transferBooleanExtra$3(str, z, intent2, (Intent) obj);
}
});
}
public static void transferIntExtra(final Intent intent, final Intent intent2, final String str) {
Optional.ofNullable(intent).filter(new Predicate() {
@Override
public final boolean test(Object obj) {
boolean lambda$transferIntExtra$0;
lambda$transferIntExtra$0 = SecureIntentUtil.lambda$transferIntExtra$0(str, (Intent) obj);
return lambda$transferIntExtra$0;
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
SecureIntentUtil.lambda$transferIntExtra$1(intent, str, intent2, (Intent) obj);
}
});
}
public static void transferStringExtra(final Intent intent, final Intent intent2, final String str) {
Optional.ofNullable(intent).filter(new Predicate() {
@Override
public final boolean test(Object obj) {
boolean lambda$transferStringExtra$4;
lambda$transferStringExtra$4 = SecureIntentUtil.lambda$transferStringExtra$4(str, (Intent) obj);
return lambda$transferStringExtra$4;
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
SecureIntentUtil.lambda$transferStringExtra$5(intent, str, intent2, (Intent) obj);
}
});
}
public static Bundle getSecureIntentExtras(Intent intent) {
Bundle bundle = new Bundle();
if (intent == null) {
return bundle;
}
try {
return intent.getExtras();
} catch (RuntimeException unused) {
KitLog.error(TAG, "getStringExtra is error");
return bundle;
}
}
public static java.lang.String getSecureIntentString(android.content.Intent r0, java.lang.String r1, java.lang.String r2) {
throw new UnsupportedOperationException("Method not decompiled: com.huawei.hiassistant.platform.base.util.SecureIntentUtil.getSecureIntentString(android.content.Intent, java.lang.String, java.lang.String):java.lang.String");
}
}