正在查看: Namma Yatri v3.3.7 应用的 MobilityAppBridge.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Namma Yatri v3.3.7 应用的 MobilityAppBridge.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package in.juspay.mobility.app;
import Jb.a;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.NotificationChannelGroup;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.RemoteException;
import android.provider.Settings;
import android.text.Html;
import android.util.Base64;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import androidx.viewpager2.widget.ViewPager2;
import com.android.installreferrer.api.InstallReferrerClient;
import com.android.installreferrer.api.InstallReferrerStateListener;
import com.google.android.gms.auth.api.credentials.Credentials;
import com.google.android.gms.auth.api.credentials.HintRequest;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManagerFactory;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.perf.metrics.Trace;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView;
import in.juspay.hyper.bridge.HyperBridge;
import in.juspay.hyper.core.BridgeComponents;
import in.juspay.hyper.core.ExecutorManager;
import in.juspay.hypersdk.core.PaymentConstants;
import in.juspay.hypersdk.data.KeyValueStore;
import in.juspay.mobility.app.MyFirebaseMessagingService;
import in.juspay.mobility.app.PermissionUtils;
import in.juspay.mobility.app.RemoteConfigs.MobilityRemoteConfigs;
import in.juspay.mobility.app.callbacks.CallBack;
import in.juspay.mobility.app.carousel.VPAdapter;
import in.juspay.mobility.app.carousel.ViewPagerItem;
import in.juspay.mobility.app.reels.ReelController;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Objects;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class MobilityAppBridge extends HyperBridge {
private static final String CALLBACK = "CALLBACK";
private static final int CALL_REQUEST_CODE = 90;
private static final String CHATS = "CHATS";
private static final int CREDENTIAL_PICKER_REQUEST = 74;
private static final String LOG_TAG = "MobilityAppBridge";
private static final String META_LOG = "META_LOG";
private static final String OVERRIDE = "OVERRIDE";
private static final String REFERRER = "REFERRER";
private static final String UTILS = "UTILS";
private static final ArrayList<SendMessageCallBack> sendMessageCallBacks = new ArrayList<>();
public static String storeCallBackOpenChatScreen;
protected static String storeChatMessageCallBack;
private static String storeCustomerCallBack;
public static String storeDetectPhoneNumbersCallBack;
private static String storeDriverCallBack;
public static float videoDuration;
public static YouTubePlayerView youTubePlayerView;
public static Hb.f youtubePlayer;
public static String youtubeVideoStatus;
private BridgeComponents bridgeComponents;
private CallBack callBack;
private com.google.common.util.concurrent.h cameraProviderFuture;
CameraUtils cameraUtils;
com.clevertap.android.sdk.i clevertapDefaultInstance;
HashMap<String, Object> clevertapProfileData;
private final FirebaseAnalytics mFirebaseAnalytics;
private MobilityRemoteConfigs remoteConfigs;
private HashMap<String, SliderComponent> sliderComponentHashMap;
private String storeAddRideStopCallBack;
protected HashMap<String, Trace> traceElements;
private final ArrayList<ViewPagerItem> viewPagerItemArrayList;
private VPAdapter vpAdapter;
public interface SendMessageCallBack {
void sendMessage(String str);
}
public MobilityAppBridge(BridgeComponents bridgeComponents) {
super(bridgeComponents);
this.clevertapProfileData = new HashMap<>();
this.viewPagerItemArrayList = new ArrayList<>();
this.storeAddRideStopCallBack = null;
this.sliderComponentHashMap = new HashMap<>();
this.bridgeComponents = bridgeComponents;
this.mFirebaseAnalytics = FirebaseAnalytics.getInstance(bridgeComponents.getContext());
this.traceElements = new HashMap<>();
this.clevertapDefaultInstance = com.clevertap.android.sdk.i.t0(bridgeComponents.getContext());
this.remoteConfigs = new MobilityRemoteConfigs(false, false);
registerCallBacks();
createVPAdapter(bridgeComponents.getContext());
initNotificationChannel(bridgeComponents.getContext());
KeyValueStore.write(bridgeComponents.getContext(), bridgeComponents.getSdkName(), "MAP_REMOTE_CONFIG", this.remoteConfigs.getString("map_config"));
KeyValueStore.write(bridgeComponents.getContext(), bridgeComponents.getSdkName(), "APP_CACHING_CONFIG", this.remoteConfigs.getString("enable_app_caching"));
}
private void createVPAdapter(Context context) {
this.vpAdapter = new VPAdapter(this.viewPagerItemArrayList, this.bridgeComponents.getContext(), new VPAdapter.VPAdapterListener() {
@Override
public void onViewHolderBind(VPAdapter.ViewHolder viewHolder, int i, Context context2) {
ViewPagerItem viewPagerItem = (ViewPagerItem) MobilityAppBridge.this.viewPagerItemArrayList.get(i);
JSONObject descriptionMargin = viewPagerItem.getDescriptionMargin();
JSONObject titleMargin = viewPagerItem.getTitleMargin();
String titleGravity = viewPagerItem.getTitleGravity();
int carouselGravity = viewPagerItem.getCarouselGravity();
String descriptionGravity = viewPagerItem.getDescriptionGravity();
float f = Resources.getSystem().getDisplayMetrics().density;
if (viewPagerItem.getContentType().equals("IMAGE")) {
if (viewPagerItem.isImageUrl()) {
com.bumptech.glide.b.t(context2).v(viewPagerItem.getImage()).A0(viewHolder.imageView);
} else {
viewHolder.imageView.setImageResource(viewPagerItem.getImageID());
}
viewHolder.imageView.getLayoutParams().height = (int) (viewPagerItem.getImageHeight() * f);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(0);
viewHolder.imageView.setVisibility(0);
gradientDrawable.setCornerRadii(new float[]{20.0f, 20.0f, 20.0f, 20.0f, 0.0f, 0.0f, 0.0f, 0.0f});
gradientDrawable.setColor(Color.parseColor(viewPagerItem.getImageBgColor()));
viewHolder.imageView.setBackground(gradientDrawable);
viewHolder.video.setVisibility(8);
} else {
MobilityAppBridge.this.vpAdapter.embedYoutubeVideo(context2, viewPagerItem.getVideoData().toString(), "PLAY", viewHolder.video);
viewHolder.video.setVisibility(0);
viewHolder.imageView.setVisibility(8);
}
viewHolder.tvHeading.setTextSize(viewPagerItem.getTitleTextSize());
viewHolder.tvHeading.setTextColor(Color.parseColor(viewPagerItem.getTitleColor()));
viewHolder.tvHeading.setText(viewPagerItem.getTitleText());
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) viewHolder.tvHeading.getLayoutParams();
marginLayoutParams.setMargins(titleMargin.optInt("left", 0), titleMargin.optInt("top", 0), titleMargin.optInt("right", 0), titleMargin.optInt("bottom", 0));
viewHolder.tvHeading.setLayoutParams(marginLayoutParams);
viewHolder.tvHeading.setGravity(Utils.getGravity(titleGravity));
viewHolder.tvDesc.setText(Html.fromHtml(viewPagerItem.getDescriptionText()));
if (viewPagerItem.getDescriptionText().equals("")) {
viewHolder.tvDesc.setVisibility(8);
}
viewHolder.tvDesc.setTextSize(viewPagerItem.getDescriptionTextSize());
viewHolder.tvDesc.setTextColor(Color.parseColor(viewPagerItem.getDescriptionColor()));
ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) viewHolder.tvDesc.getLayoutParams();
marginLayoutParams2.setMargins(descriptionMargin.optInt("left", 0) * 2, descriptionMargin.optInt("top", 0), descriptionMargin.optInt("right", 0), descriptionMargin.optInt("bottom", 0));
viewHolder.tvDesc.setLayoutParams(marginLayoutParams2);
viewHolder.tvDesc.setGravity(Utils.getGravity(descriptionGravity));
viewHolder.parentLinearLayout.setGravity(carouselGravity);
}
});
}
public static void deRegisterSendMessageCallBack(SendMessageCallBack sendMessageCallBack) {
sendMessageCallBacks.remove(sendMessageCallBack);
}
private void initNotificationChannel(Context context) {
NotificationManager notificationManager = (NotificationManager) context.getSystemService(NotificationManager.class);
if (Build.VERSION.SDK_INT >= 26) {
try {
k3.B.a(notificationManager, "RINGING_ALERT");
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.TRIP_STARTED);
k3.B.a(notificationManager, "General");
k3.B.a(notificationManager, "FLOATING_NOTIFICATION");
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.DRIVER_QUOTE_INCOMING);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.DRIVER_ASSIGNMENT);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.REALLOCATE_PRODUCT);
k3.B.a(notificationManager, "GENERAL_NOTIFICATION");
k3.B.a(notificationManager, "RIDE_STARTED");
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.CANCELLED_PRODUCT);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.DRIVER_HAS_REACHED);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.TRIP_FINISHED);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.SOS_TRIGGERED);
k3.B.a(notificationManager, MyFirebaseMessagingService.NotificationTypes.SOS_RESOLVED);
} catch (Exception unused) {
System.out.println("Notification Channel doesn't exists");
}
}
int i = Build.VERSION.SDK_INT;
if (i >= 26) {
NotificationChannelGroup a = k3.u.a("1_safety", "Enhanced Safety");
NotificationChannelGroup a2 = k3.u.a("2_ride_related", "Essential - Ride related");
NotificationChannelGroup a3 = k3.u.a("3_services", "Services");
NotificationChannelGroup a4 = k3.u.a("4_promotional", "Promotional");
if (i >= 28) {
a.setDescription("Notifications related to Safety");
a2.setDescription("Notifications related to ride starts, end");
a3.setDescription("Notifications related to Services");
a4.setDescription("Notifications related to promotional");
}
k3.v.a(notificationManager, a);
k3.v.a(notificationManager, a2);
k3.v.a(notificationManager, a3);
k3.v.a(notificationManager, a4);
}
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.DRIVER_QUOTE_INCOMING);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.DRIVER_ASSIGNMENT);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.REALLOCATE_PRODUCT);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.GENERAL_NOTIFICATION);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.RIDE_STARTED);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.CANCELLED_PRODUCT);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.DRIVER_HAS_REACHED);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.SOS_TRIGGERED);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.SOS_RESOLVED);
NotificationUtils.createNotificationChannel(this.bridgeComponents.getContext(), NotificationUtils.NOSOUND_NOTIFICATION);
}
public void lambda$addCarousel$7(final Context context, String str, LinearLayout linearLayout) {
final View viewPager2 = new ViewPager2(context);
LinearLayout linearLayout2 = new LinearLayout(context);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
ViewGroup.LayoutParams layoutParams2 = new ViewGroup.LayoutParams(-1, -1);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, -1);
LinearLayout linearLayout3 = new LinearLayout(context);
linearLayout3.setOrientation(1);
linearLayout3.setLayoutParams(layoutParams3);
ScrollView scrollView = new ScrollView(context);
scrollView.setLayoutParams(layoutParams2);
ArrayList arrayList = new ArrayList();
try {
JSONArray jSONArray = new JSONArray(str);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
arrayList.add(new ViewPagerItem(Utils.getResIdentifier(context, jSONObject.getString("image"), "drawable"), jSONObject.getString("title"), jSONObject.getString("description")));
}
VPAdapter vPAdapter = new VPAdapter(arrayList);
viewPager2.setAdapter(vPAdapter);
final int itemCount = vPAdapter.getItemCount();
final ImageView[] imageViewArr = new ImageView[itemCount];
for (final int i2 = 0; i2 < itemCount; i2++) {
ImageView imageView = new ImageView(context);
imageViewArr[i2] = imageView;
imageView.setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_inactive));
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(28, 28);
layoutParams4.setMargins(14, 0, 14, 0);
linearLayout2.addView(imageViewArr[i2], layoutParams4);
imageViewArr[0].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_active));
imageViewArr[i2].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
viewPager2.setCurrentItem(i2);
}
});
}
linearLayout2.setLayoutParams(layoutParams);
viewPager2.g(new ViewPager2.i() {
public void onPageScrollStateChanged(int i3) {
super.onPageScrollStateChanged(i3);
}
public void onPageScrolled(int i3, float f, int i4) {
super.onPageScrolled(i3, f, i4);
}
public void onPageSelected(int i3) {
int i4 = 0;
while (i4 < itemCount) {
imageViewArr[i4].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_inactive));
ImageView imageView2 = imageViewArr[i4];
StringBuilder sb2 = new StringBuilder();
sb2.append("Page Indicator, Page ");
i4++;
sb2.append(i4);
sb2.append(" : Swipe or Tap To Go To Next Page\"");
imageView2.setContentDescription(sb2.toString());
}
imageViewArr[i3].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_active));
super.onPageSelected(i3);
}
});
linearLayout3.addView(viewPager2);
linearLayout3.setGravity(80);
linearLayout3.addView(linearLayout2);
linearLayout3.setWeightSum(2.0f);
scrollView.addView(linearLayout3);
scrollView.setFillViewport(true);
layoutParams.weight = 1.0f;
linearLayout2.setGravity(81);
linearLayout.addView(scrollView);
} catch (Exception e) {
android.util.Log.e(UTILS, "Exception" + e);
}
}
public void lambda$addCarouselWithVideo$5(final Context context, LinearLayout linearLayout, String str) {
final View viewPager2 = new ViewPager2(context);
LinearLayout linearLayout2 = new LinearLayout(context);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
ViewGroup.LayoutParams layoutParams2 = new ViewGroup.LayoutParams(-1, linearLayout.getHeight());
ScrollView scrollView = new ScrollView(context);
scrollView.setLayoutParams(layoutParams2);
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, linearLayout.getHeight());
LinearLayout linearLayout3 = new LinearLayout(context);
linearLayout3.setOrientation(1);
linearLayout3.setLayoutParams(layoutParams3);
try {
JSONObject jSONObject = new JSONObject(str);
linearLayout3.setGravity(Utils.getGravity(jSONObject.optString("gravity", "CENTER")));
JSONArray jSONArray = jSONObject.getJSONArray("carouselData");
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject2 = jSONArray.getJSONObject(i);
JSONObject jSONObject3 = jSONObject2.getJSONObject("imageConfig");
this.viewPagerItemArrayList.add(new ViewPagerItem(Utils.getResIdentifier(context, jSONObject3.getString("image"), "drawable"), jSONObject3, jSONObject2.getJSONObject("descriptionConfig"), jSONObject2.getJSONObject("titleConfig"), jSONObject2.getString("contentType"), jSONObject2.getJSONObject("youtubeConfig"), jSONObject2.optInt("gravity", 17)));
}
viewPager2.setAdapter(this.vpAdapter);
final int itemCount = this.vpAdapter.getItemCount();
final ImageView[] imageViewArr = new ImageView[itemCount];
for (final int i2 = 0; i2 < itemCount; i2++) {
ImageView imageView = new ImageView(context);
imageViewArr[i2] = imageView;
imageView.setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_inactive));
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(28, 28);
layoutParams4.setMargins(14, 0, 14, 0);
linearLayout2.addView(imageViewArr[i2], layoutParams4);
imageViewArr[0].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_active));
imageViewArr[i2].setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
viewPager2.setCurrentItem(i2);
}
});
}
linearLayout2.setLayoutParams(layoutParams);
viewPager2.setLayoutParams(new ViewGroup.LayoutParams(linearLayout.getWidth(), linearLayout.getHeight() - 50));
viewPager2.g(new ViewPager2.i() {
public void onPageScrollStateChanged(int i3) {
super.onPageScrollStateChanged(i3);
}
public void onPageScrolled(int i3, float f, int i4) {
super.onPageScrolled(i3, f, i4);
}
public void onPageSelected(int i3) {
int i4 = 0;
while (i4 < itemCount) {
imageViewArr[i4].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_inactive));
ImageView imageView2 = imageViewArr[i4];
StringBuilder sb2 = new StringBuilder();
sb2.append("Page Indicator, Page ");
i4++;
sb2.append(i4);
sb2.append(" : Swipe or Tap To Go To Next Page\"");
imageView2.setContentDescription(sb2.toString());
}
imageViewArr[i3].setImageDrawable(androidx.core.content.a.getDrawable(context, R.drawable.carousel_dot_active));
super.onPageSelected(i3);
}
});
linearLayout3.addView(viewPager2);
linearLayout3.addView(linearLayout2);
scrollView.addView(linearLayout3);
linearLayout2.setGravity(81);
linearLayout.addView(scrollView);
} catch (Exception e) {
android.util.Log.e(UTILS, "Exception" + e);
}
}
public void lambda$cleverTapCustomEvent$14(String str) {
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
iVar.R1(str);
}
}
public void lambda$cleverTapCustomEventWithParams$15(String str, String str2, String str3) {
HashMap hashMap = new HashMap();
hashMap.put(str, str2);
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
iVar.S1(str3, hashMap);
}
}
public void lambda$cleverTapEvent$9(String str, String str2) {
if (this.clevertapDefaultInstance != null) {
HashMap hashMap = new HashMap();
try {
JSONArray jSONArray = new JSONArray(str);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
hashMap.put(jSONObject.getString("key"), jSONObject.get("value"));
}
this.clevertapDefaultInstance.S1(str2, hashMap);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
public void lambda$cleverTapSetLocation$16() {
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
this.clevertapDefaultInstance.x2(iVar.G0());
}
}
public static void lambda$launchInAppRatingPopup$2(Task task) {
}
public void lambda$launchInAppRatingPopup$3(p8.b bVar, Task task) {
if (!task.isSuccessful() || this.bridgeComponents.getActivity() == null) {
return;
}
bVar.b(this.bridgeComponents.getActivity(), (ReviewInfo) task.getResult()).addOnCompleteListener(new OnCompleteListener() {
public final void onComplete(Task task2) {
MobilityAppBridge.lambda$launchInAppRatingPopup$2(task2);
}
});
}
public void lambda$loginCleverTapUser$10() {
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
iVar.H1(this.clevertapProfileData);
this.clevertapDefaultInstance.T1(this.bridgeComponents.getContext().getSharedPreferences(this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0).getString("FCM_TOKEN", "null"), true);
}
}
public void lambda$renderSlider$18(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
String string = jSONObject.getString("id");
String optString = jSONObject.optString("callback", "");
float optDouble = (float) jSONObject.optDouble("sliderConversionRate", 1.0d);
int optInt = jSONObject.optInt("sliderMinValue", 1);
int optInt2 = jSONObject.optInt("sliderMaxValue", 10);
int optInt3 = jSONObject.optInt("sliderDefaultValue", 1);
int optInt4 = jSONObject.optInt("stepFunctionForCoinConversion", 1);
String optString2 = jSONObject.optString("toolTipId", "");
Boolean valueOf = Boolean.valueOf(jSONObject.optBoolean("enableToolTip", false));
String optString3 = jSONObject.optString("progressColor", "#FFFFFF");
String optString4 = jSONObject.optString("bgColor", String.valueOf(-16777216));
String optString5 = jSONObject.optString("thumbColor", "#2194FF");
int optInt5 = jSONObject.optInt("bgAlpha", 50);
Boolean valueOf2 = Boolean.valueOf(jSONObject.optBoolean("getCallbackOnProgressChanged", false));
SliderComponent sliderComponent = new SliderComponent();
this.sliderComponentHashMap.put(string, sliderComponent);
sliderComponent.addSlider(string, optString, optInt4, optDouble, optInt, optInt2, optInt3, optString2, valueOf, optString3, optString5, optString4, optInt5, valueOf2, this.bridgeComponents);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void lambda$setCleverTapUserData$11(String str, String str2) {
HashMap hashMap = new HashMap();
try {
hashMap.put(str, str2);
} catch (Exception e) {
android.util.Log.e(UTILS, "Error sending user data: " + e);
}
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
iVar.H1(hashMap);
this.clevertapDefaultInstance.T1(this.bridgeComponents.getContext().getSharedPreferences(this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0).getString("FCM_TOKEN", "null"), true);
}
}
public void lambda$setCleverTapUserMultipleProp$13(String str) {
if (this.clevertapDefaultInstance == null) {
this.clevertapDefaultInstance = com.clevertap.android.sdk.i.t0(this.bridgeComponents.getContext());
}
HashMap hashMap = new HashMap();
try {
JSONArray jSONArray = new JSONArray(str);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
hashMap.put(jSONObject.getString("key"), jSONObject.get("value"));
}
this.clevertapDefaultInstance.Y1(hashMap);
} catch (JSONException e) {
e.printStackTrace();
}
}
public void lambda$setCleverTapUserProp$12(String str, String str2) {
HashMap hashMap = new HashMap();
try {
hashMap.put(str, str2);
} catch (Exception e) {
android.util.Log.e(UTILS, "Error sending user data: " + e);
}
com.clevertap.android.sdk.i iVar = this.clevertapDefaultInstance;
if (iVar != null) {
iVar.Y1(hashMap);
}
}
public void lambda$setFCMToken$0(String str, Task task) {
if (task.isSuccessful()) {
String str2 = (String) task.getResult();
KeyValueStore.write(this.bridgeComponents.getContext(), this.bridgeComponents.getSdkName(), "FCM_TOKEN", str2);
String format = String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, str2);
if (str != null) {
this.bridgeComponents.getJsCallback().addJsToWebView(format);
}
}
}
public void lambda$setFCMToken$1(final String str) {
FirebaseMessaging.t().w().addOnCompleteListener(new OnCompleteListener() {
public final void onComplete(Task task) {
MobilityAppBridge.this.lambda$setFCMToken$0(str, task);
}
});
}
public void lambda$setYoutubePlayer$8(String str, String str2, String str3, final String str4) {
try {
if (str.equals("PAUSE")) {
pauseYoutubeVideo();
return;
}
JSONObject jSONObject = new JSONObject(str2);
YouTubePlayerView youTubePlayerView2 = youTubePlayerView;
if (youTubePlayerView2 != null) {
youTubePlayerView2.release();
}
final boolean z = jSONObject.getBoolean("showMenuButton");
final boolean z2 = jSONObject.getBoolean("showDuration");
final boolean z3 = jSONObject.getBoolean("setVideoTitle");
final boolean z4 = jSONObject.getBoolean("showSeekBar");
final String string = jSONObject.getString("videoTitle");
final String string2 = jSONObject.getString("videoId");
boolean z5 = jSONObject.getBoolean("showFullScreen");
final boolean z6 = jSONObject.getBoolean("hideFullScreenButton");
final String string3 = jSONObject.has("videoType") ? jSONObject.getString("videoType") : "VIDEO";
youTubePlayerView = new YouTubePlayerView(this.bridgeComponents.getContext());
((LinearLayout) this.bridgeComponents.getActivity().findViewById(Integer.parseInt(str3))).addView(youTubePlayerView);
youTubePlayerView.setEnableAutomaticInitialization(false);
if (z5) {
youTubePlayerView.e();
}
Ib.a aVar = new Ib.a() {
@Override
public void onCurrentSecond(Hb.f fVar, float f) {
MobilityAppBridge.videoDuration = f;
}
@Override
public void onReady(Hb.f fVar) {
try {
MobilityAppBridge.youtubePlayer = fVar;
if (MobilityAppBridge.youTubePlayerView == null || MobilityAppBridge.youtubePlayer == null) {
return;
}
Mb.g gVar = new Mb.g(MobilityAppBridge.youTubePlayerView, fVar);
gVar.F(z);
gVar.D(z2);
gVar.G(z4);
gVar.E(!z6);
if (z3) {
gVar.C(string);
}
gVar.H(false);
MobilityAppBridge.youTubePlayerView.setCustomPlayerUi(gVar.v());
fVar.a(MobilityAppBridge.videoDuration);
fVar.e(string2, 0.0f);
if (MobilityAppBridge.youtubeVideoStatus.equals("PAUSE")) {
fVar.pause();
} else {
fVar.play();
}
System.out.println("Youtube OnReady");
} catch (Exception e) {
android.util.Log.e("error inside setYoutubePlayer onReady", String.valueOf(e));
}
}
@Override
public void onStateChange(Hb.f fVar, Hb.d dVar) {
MobilityAppBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str4, dVar));
}
};
youTubePlayerView.c(new Ib.b() {
@Override
public void onYouTubePlayerEnterFullScreen() {
Intent intent = new Intent(MobilityAppBridge.this.bridgeComponents.getContext(), (Class<?>) YoutubeVideoView.class);
intent.addFlags(268435456);
intent.putExtra("videoId", string2);
intent.putExtra("videoDuration", MobilityAppBridge.videoDuration);
intent.putExtra("videoType", string3);
MobilityAppBridge.this.bridgeComponents.getContext().startActivity(intent);
}
@Override
public void onYouTubePlayerExitFullScreen() {
}
});
youTubePlayerView.g(aVar, new a.C0012a().d(0).e(0).c());
} catch (Exception e) {
android.util.Log.e("exception in setYoutubePlayer", String.valueOf(e));
}
}
public void lambda$updateSliderValue$17(String str) {
try {
JSONObject jSONObject = new JSONObject(str);
int optInt = jSONObject.optInt("sliderValue", 0);
SliderComponent sliderComponent = this.sliderComponentHashMap.get(jSONObject.getString("id"));
if (sliderComponent != null) {
sliderComponent.updateSliderValue(optInt);
}
} catch (Exception e) {
android.util.Log.e(UTILS, "Error in updating slider value: " + e);
e.printStackTrace();
}
}
public static void registerSendMessageCallBack(SendMessageCallBack sendMessageCallBack) {
sendMessageCallBacks.add(sendMessageCallBack);
}
@JavascriptInterface
public void addCarousel(final String str, String str2) {
Activity activity = this.bridgeComponents.getActivity();
final Context context = this.bridgeComponents.getContext();
final LinearLayout linearLayout = activity != null ? (LinearLayout) activity.findViewById(Integer.parseInt(str2)) : null;
if (activity == null || linearLayout == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$addCarousel$7(context, str, linearLayout);
}
});
}
@JavascriptInterface
public void addCarouselWithVideo(final String str, String str2) {
this.viewPagerItemArrayList.clear();
Activity activity = this.bridgeComponents.getActivity();
final Context context = this.bridgeComponents.getContext();
final LinearLayout linearLayout = activity != null ? (LinearLayout) activity.findViewById(Integer.parseInt(str2)) : null;
if (activity == null || linearLayout == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$addCarouselWithVideo$5(context, linearLayout, str);
}
});
}
@JavascriptInterface
public void addCrashlyticsCustomKey(String str, String str2) {
FirebaseCrashlytics.getInstance().setCustomKey(str, str2);
}
@JavascriptInterface
public void addReels(String str, int i, String str2, String str3) {
this.bridgeComponents.getActivity();
final Context context = this.bridgeComponents.getContext();
this.bridgeComponents.getContext().getSharedPreferences(this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0).edit().putString("ANOTHER_ACTIVITY_LAUNCHED", "true").apply();
ReelController.registerCallback(new ReelController.ReelControllerCallback() {
@Override
public void sendJsCallBack(String str4) {
MobilityAppBridge.this.bridgeComponents.getJsCallback().addJsToWebView(str4);
}
});
ReelController.registerReelActivity(new ReelController.ReelActivityInterface() {
@Override
public void onPauseCallback() {
String str4;
try {
SharedPreferences sharedPreferences = MobilityAppBridge.this.bridgeComponents.getContext().getSharedPreferences(MobilityAppBridge.this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0);
sharedPreferences.edit().putString("ANOTHER_ACTIVITY_LAUNCHED", "false").apply();
Intent intent = new Intent(context, (Class<?>) WidgetService.class);
String string = context.getResources().getString(R.string.service);
if (!string.contains("partner") && !string.contains("driver") && !string.contains("provider")) {
str4 = "USER";
if (str4.equals("DRIVER") || !Settings.canDrawOverlays(context) || sharedPreferences.getString(context.getResources().getString(R.string.REGISTERATION_TOKEN), "null").equals("null") || sharedPreferences.getString("DISABLE_WIDGET", "true").equals("true") || sharedPreferences.getString("ANOTHER_ACTIVITY_LAUNCHED", "false").equals("true")) {
return;
}
intent.putExtra(PaymentConstants.PAYLOAD, "{}");
intent.putExtra("data", "{}");
context.startService(intent);
return;
}
str4 = "DRIVER";
if (str4.equals("DRIVER")) {
}
} catch (Exception unused) {
android.util.Log.i("REELS", "Error in onPauseCallback");
}
}
@Override
public void onResumeCallback() {
try {
MobilityAppBridge.this.bridgeComponents.getContext().getSharedPreferences(MobilityAppBridge.this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0).edit().putString("ANOTHER_ACTIVITY_LAUNCHED", "true").apply();
context.stopService(new Intent(context, (Class<?>) WidgetService.class));
} catch (Exception unused) {
android.util.Log.i("REELS", "Error in onResumeCallback");
}
}
});
Intent intent = new Intent(context, (Class<?>) ReelsPlayerView.class);
intent.addFlags(268435456);
intent.putExtra("reelsJSONData", str);
intent.putExtra("index", i);
intent.putExtra("callback", str3);
intent.putExtra("id", str2);
context.startActivity(intent);
}
@JavascriptInterface
public void askRequestedPermissions(String[] strArr) {
PermissionUtils.askRequestedPermissions(this.bridgeComponents.getActivity(), this.bridgeComponents.getContext(), strArr, null);
}
@JavascriptInterface
public void askRequestedPermissionsWithCallback(String[] strArr, final String str) {
PermissionUtils.askRequestedPermissions(this.bridgeComponents.getActivity(), this.bridgeComponents.getContext(), strArr, new PermissionUtils.PermissionCallback() {
@Override
public void onPermissionsDenied() {
String format = String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, Boolean.FALSE);
if (str != null) {
MobilityAppBridge.this.bridgeComponents.getJsCallback().addJsToWebView(format);
}
}
@Override
public void onPermissionsGranted() {
String format = String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", str, Boolean.TRUE);
if (str != null) {
MobilityAppBridge.this.bridgeComponents.getJsCallback().addJsToWebView(format);
}
}
});
}
public void callChatMessageCallBack(String str, String str2, String str3, String str4) {
String str5 = storeChatMessageCallBack;
if (str5 != null) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window.callUICallback(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\");", str5, str, str2, str3, str4));
}
}
public void callDriverAddRideStopCallBack(String str) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", this.storeAddRideStopCallBack, str));
}
public void callDriverNotificationCallBack(String str, String str2) {
if (storeDriverCallBack != null) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s');", storeDriverCallBack, str, str2.replace("'", "")));
}
}
public void callInAppNotificationCallBack(String str) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback(\"%s\");", str));
}
public void callingStoreCallCustomer(String str, String str2) {
if (storeCustomerCallBack != null) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s','%s');", storeCustomerCallBack, str, str2.replace("'", "")));
}
}
@JavascriptInterface
public void cleverTapCustomEvent(final String str) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$cleverTapCustomEvent$14(str);
}
});
}
@JavascriptInterface
public void cleverTapCustomEventWithParams(final String str, final String str2, final String str3) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$cleverTapCustomEventWithParams$15(str2, str3, str);
}
});
}
@JavascriptInterface
public void cleverTapEvent(final String str, final String str2) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$cleverTapEvent$9(str2, str);
}
});
}
@JavascriptInterface
public void cleverTapSetLocation() {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$cleverTapSetLocation$16();
}
});
}
@JavascriptInterface
public String decodeAndStoreImage(String str) {
try {
byte[] decode = Base64.decode(str, 0);
File file = new File(this.bridgeComponents.getContext().getCacheDir(), "image_" + System.currentTimeMillis() + ".png");
FileOutputStream fileOutputStream = new FileOutputStream(file);
fileOutputStream.write(decode);
fileOutputStream.close();
return file.getAbsolutePath();
} catch (IOException e) {
e.printStackTrace();
return "FAILED";
}
}
@JavascriptInterface
public void detectPhoneNumbers(String str) {
try {
storeDetectPhoneNumbersCallBack = str;
PendingIntent hintPickerIntent = Credentials.getClient(this.bridgeComponents.getContext()).getHintPickerIntent(new HintRequest.Builder().setPhoneNumberIdentifierSupported(true).build());
if (this.bridgeComponents.getActivity() != null) {
androidx.core.app.b.l(this.bridgeComponents.getActivity(), hintPickerIntent.getIntentSender(), CREDENTIAL_PICKER_REQUEST, (Intent) null, 0, 0, 0, new Bundle());
}
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
}
@JavascriptInterface
public void extractReferrerUrl() {
final InstallReferrerClient a = InstallReferrerClient.c(this.bridgeComponents.getContext()).a();
a.d(new InstallReferrerStateListener() {
public void onInstallReferrerServiceDisconnected() {
android.util.Log.i(MobilityAppBridge.REFERRER, "referrer service disconnected");
}
public void onInstallReferrerSetupFinished(int i) {
if (i != 0) {
if (i == 1) {
android.util.Log.i(MobilityAppBridge.REFERRER, "Service unavailable");
MobilityAppBridge.this.firebaseLogEvent("referrer_url_service_unavailable");
return;
} else {
if (i != 2) {
return;
}
android.util.Log.i(MobilityAppBridge.REFERRER, "Feature not supported");
MobilityAppBridge.this.firebaseLogEvent("referrer_url_feature_not_supported");
return;
}
}
try {
String d = a.b().d();
MobilityAppBridge.this.bridgeComponents.getContext().getSharedPreferences(MobilityAppBridge.this.bridgeComponents.getContext().getString(R.string.preference_file_key), 0).edit().putString("REFERRER_URL", d).apply();
MobilityAppBridge.this.firebaseLogEvent("referrer_url_" + d);
} catch (RemoteException e) {
MobilityAppBridge.this.firebaseLogEvent("referrer_url_error_occurred_in_fetching_referrer_info");
e.printStackTrace();
}
}
});
}
@JavascriptInterface
@Deprecated
public void factoryResetApp() {
if (this.bridgeComponents.getActivity() != null) {
Intent launchIntentForPackage = this.bridgeComponents.getActivity().getPackageManager().getLaunchIntentForPackage(this.bridgeComponents.getActivity().getPackageName());
this.bridgeComponents.getActivity().finishAffinity();
this.bridgeComponents.getContext().startActivity(launchIntentForPackage);
}
}
@JavascriptInterface
public void fetchAndUpdateRemoteConfig() {
this.remoteConfigs = new MobilityRemoteConfigs(true, false);
}
@JavascriptInterface
public boolean fetchRemoteConfigBool(String str) {
return this.remoteConfigs.getBoolean(str);
}
@JavascriptInterface
public double fetchRemoteConfigDouble(String str) {
return this.remoteConfigs.getDouble(str);
}
@JavascriptInterface
public long fetchRemoteConfigLong(String str) {
return this.remoteConfigs.getLong(str);
}
@JavascriptInterface
public String fetchRemoteConfigString(String str) {
return this.remoteConfigs.getString(str);
}
@JavascriptInterface
public void firebaseLogEvent(String str) {
this.mFirebaseAnalytics.c(str, new Bundle());
}
@JavascriptInterface
public void firebaseLogEventWithArrayOfKeyValue(String str) {
Bundle bundle = new Bundle();
try {
JSONObject jSONObject = new JSONObject(str);
String optString = jSONObject.optString("event");
JSONArray jSONArray = new JSONArray(jSONObject.optString("object"));
if (jSONArray.length() > 0) {
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject2 = jSONArray.getJSONObject(i);
bundle.putString(jSONObject2.getString("key"), jSONObject2.getString("value"));
}
this.mFirebaseAnalytics.c(optString, bundle);
}
} catch (JSONException e) {
android.util.Log.e("JSON_EXCEPTION", "Error in firebaseLogEventWithArrayOfKeyValue: ", e);
}
}
@JavascriptInterface
public void firebaseLogEventWithParams(String str, String str2, String str3) {
Bundle bundle = new Bundle();
bundle.putString(str2, str3);
this.mFirebaseAnalytics.c(str, bundle);
}
@JavascriptInterface
public void firebaseLogEventWithTwoParams(String str, String str2, String str3, String str4, String str5) {
Bundle bundle = new Bundle();
bundle.putString(str2, str3);
bundle.putString(str4, str5);
this.mFirebaseAnalytics.c(str, bundle);
}
@JavascriptInterface
public void firebaseUserID(String str) {
this.mFirebaseAnalytics.i(str);
}
@JavascriptInterface
public void launchInAppRatingPopup() {
final p8.b create = ReviewManagerFactory.create(this.bridgeComponents.getContext());
create.a().addOnCompleteListener(new OnCompleteListener() {
public final void onComplete(Task task) {
MobilityAppBridge.this.lambda$launchInAppRatingPopup$3(create, task);
}
});
}
@JavascriptInterface
public void loginCleverTapUser() {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$loginCleverTapUser$10();
}
});
}
@JavascriptInterface
public void metaLogEvent(String str) {
try {
a4.p.k(this.bridgeComponents.getContext()).e(str);
} catch (Exception e) {
android.util.Log.e(META_LOG, "Error in metaLogEvent " + e);
}
}
@JavascriptInterface
public void metaLogEventWithParams(String str, String str2, String str3) {
try {
Bundle bundle = new Bundle();
bundle.putString(str2, str3);
a4.p.k(this.bridgeComponents.getContext()).g(str, bundle);
} catch (Exception e) {
android.util.Log.e(META_LOG, "Error in metaLogEventWithParams : " + e);
}
}
@JavascriptInterface
public void metaLogEventWithTwoParams(String str, String str2, String str3, String str4, String str5) {
try {
Bundle bundle = new Bundle();
bundle.putString(str2, str3);
bundle.putString(str4, str5);
a4.p.k(this.bridgeComponents.getContext()).g(str, bundle);
} catch (Exception e) {
android.util.Log.e(META_LOG, "Error in metaLogEventWithTwoParams : " + e);
}
}
@Override
public boolean onActivityResult(int i, int i2, Intent intent) {
if (i == CREDENTIAL_PICKER_REQUEST && i2 == -1) {
this.bridgeComponents.getJsCallback().addJsToWebView(String.format(Locale.ENGLISH, "window.callUICallback('%s','%s');", storeDetectPhoneNumbersCallBack, intent.getParcelableExtra("com.google.android.gms.credentials.Credential").getId().substring(3)));
}
return super.onActivityResult(i, i2, intent);
}
@JavascriptInterface
public void openWhatsAppSupport(String str) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("https://api.whatsapp.com/send?phone=" + str));
intent.addFlags(268435456);
this.bridgeComponents.getContext().startActivity(intent);
}
@JavascriptInterface
public void pauseYoutubeVideo() {
VPAdapter vPAdapter = this.vpAdapter;
if (vPAdapter != null) {
vPAdapter.pauseYoutubeVideo();
}
Hb.f fVar = youtubePlayer;
if (fVar != null) {
fVar.pause();
}
youtubeVideoStatus = "PAUSE";
youTubePlayerView = null;
}
@JavascriptInterface
public void recordVideo(String str) {
CameraUtils cameraUtils = this.cameraUtils;
if (cameraUtils != null) {
cameraUtils.recordVideo(this.bridgeComponents.getActivity(), this.bridgeComponents.getContext(), str, this.bridgeComponents);
}
}
public void registerCallBacks() {
CallBack callBack = new CallBack() {
@Override
public void addStopCallBack(String str) {
MobilityAppBridge.this.callDriverAddRideStopCallBack(str);
}
@Override
public void bundleUpdatedCallBack(String str, JSONObject jSONObject) {
MobilityAppBridge.this.bridgeComponents.getJsCallback().addJsToWebView(String.format("window[\"onEvent'\"]('%s','%s')", str, jSONObject.toString()));
}
@Override
public void chatCallBack(String str, String str2, String str3, String str4) {
MobilityAppBridge.this.callChatMessageCallBack(str, str2, str3, str4);
}
@Override
public void customerCallBack(String str, String str2) {
MobilityAppBridge.this.callingStoreCallCustomer(str, str2);
}
@Override
public void driverCallBack(String str, String str2) {
MobilityAppBridge.this.callDriverNotificationCallBack(str, str2);
}
@Override
public void inAppCallBack(String str) {
MobilityAppBridge.this.callInAppNotificationCallBack(str);
}
};
this.callBack = callBack;
NotificationUtils.registerCallback(callBack);
ChatService.registerCallback(this.callBack);
InAppNotification.registerCallback(this.callBack);
RemoteAssetsDownloader.registerCallback(this.callBack);
OverlaySheetService.registerCallback(this.callBack);
}
@JavascriptInterface
public void releaseYoutubeView() {
youtubeVideoStatus = "PAUSE";
final YouTubePlayerView youTubePlayerView2 = youTubePlayerView;
Objects.requireNonNull(youTubePlayerView2);
ExecutorManager.runOnMainThread(new Runnable() {
@Override
public final void run() {
YouTubePlayerView.this.release();
}
});
youTubePlayerView = null;
}
@JavascriptInterface
public void removeCallBackOpenChatScreen() {
storeCallBackOpenChatScreen = null;
}
@JavascriptInterface
public void removeChatMessageCallback() {
storeChatMessageCallBack = null;
}
@JavascriptInterface
public void renderSlider(final String str) {
ExecutorManager.runOnMainThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$renderSlider$18(str);
}
});
}
@Override
public void reset() {
NotificationUtils.deRegisterCallback(this.callBack);
ChatService.deRegisterCallback(this.callBack);
InAppNotification.deRegisterCallBack(this.callBack);
RemoteAssetsDownloader.deRegisterCallback(this.callBack);
OverlaySheetService.deRegisterCallback(this.callBack);
}
@JavascriptInterface
public void restartApp() {
if (this.bridgeComponents.getActivity() != null) {
Intent launchIntentForPackage = this.bridgeComponents.getActivity().getPackageManager().getLaunchIntentForPackage(this.bridgeComponents.getActivity().getPackageName());
this.bridgeComponents.getActivity().finishAffinity();
this.bridgeComponents.getContext().startActivity(launchIntentForPackage);
}
}
@JavascriptInterface
public void sendMessage(String str) {
Iterator<SendMessageCallBack> it = sendMessageCallBacks.iterator();
while (it.hasNext()) {
it.next().sendMessage(str);
}
}
@JavascriptInterface
public void setCleverTapProfileData(String str, String str2) {
this.clevertapProfileData.put(str, str2);
}
@JavascriptInterface
public void setCleverTapUserData(final String str, final String str2) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$setCleverTapUserData$11(str, str2);
}
});
}
@JavascriptInterface
public void setCleverTapUserMultipleProp(final String str) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$setCleverTapUserMultipleProp$13(str);
}
});
}
@JavascriptInterface
public void setCleverTapUserProp(final String str, final String str2) {
ExecutorManager.runOnBackgroundThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$setCleverTapUserProp$12(str, str2);
}
});
}
@JavascriptInterface
public void setFCMToken(final String str) {
ExecutorManager.runOnMainThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$setFCMToken$1(str);
}
});
}
@JavascriptInterface
public void setYoutubePlayer(final String str, final String str2, final String str3, final String str4) {
if (this.bridgeComponents.getActivity() != null) {
videoDuration = 0.0f;
youtubeVideoStatus = str3;
ExecutorManager.runOnMainThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$setYoutubePlayer$8(str3, str, str2, str4);
}
});
}
}
@JavascriptInterface
public void setupCamera(String str, boolean z) {
CameraUtils cameraUtils = new CameraUtils();
this.cameraUtils = cameraUtils;
cameraUtils.setupCamera(this.bridgeComponents.getActivity(), this.bridgeComponents.getContext(), str, z);
}
@JavascriptInterface
public void startChatListenerService() {
try {
Context context = this.bridgeComponents.getContext();
String string = context.getSharedPreferences(context.getString(R.string.preference_file_key), 0).getString("ACTIVITY_STATUS", "null");
Intent intent = new Intent(context, (Class<?>) ChatService.class);
int i = Build.VERSION.SDK_INT;
if (i >= 31 && string.equals("onPause")) {
((AlarmManager) context.getSystemService("alarm")).setExact(0, System.currentTimeMillis(), PendingIntent.getBroadcast(context, 0, new Intent(context, (Class<?>) ChatBroadCastReceiver.class), 67108864));
} else if (i >= 26) {
context.startForegroundService(intent);
} else {
context.startService(intent);
}
} catch (Exception e) {
android.util.Log.e(CHATS, "Failed to start ChatService : " + e);
}
}
@JavascriptInterface
public void startTracingPerf(String str) {
Trace e = Q9.e.c().e(str);
e.start();
this.traceElements.put(str, e);
}
@JavascriptInterface
public void stopChatListenerService() {
try {
Intent intent = new Intent(this.bridgeComponents.getContext(), (Class<?>) ChatService.class);
Intent intent2 = new Intent(this.bridgeComponents.getContext(), (Class<?>) MessageOverlayService.class);
this.bridgeComponents.getContext().stopService(intent);
this.bridgeComponents.getContext().stopService(intent2);
} catch (Exception e) {
android.util.Log.e(CHATS, "Failed to stop ChatService : " + e);
}
}
@JavascriptInterface
public void stopRecord() {
CameraUtils cameraUtils = this.cameraUtils;
if (cameraUtils != null) {
cameraUtils.stopRecord();
}
}
@JavascriptInterface
public void stopTracingPerf(String str) {
if (this.traceElements.containsKey(str)) {
this.traceElements.get(str).stop();
this.traceElements.remove(str);
}
}
@JavascriptInterface
public void storeCallBackCustomer(String str) {
storeCustomerCallBack = str;
}
@JavascriptInterface
public void storeCallBackForAddRideStop(String str) {
this.storeAddRideStopCallBack = str;
}
@JavascriptInterface
public void storeCallBackForNotification(String str) {
storeDriverCallBack = str;
}
@JavascriptInterface
public void storeCallBackMessageUpdated(String str, String str2, String str3) {
storeChatMessageCallBack = str3;
KeyValueStore.write(this.bridgeComponents.getContext(), this.bridgeComponents.getSdkName(), "CHAT_CHANNEL_ID", str);
ChatService.chatChannelID = str;
ChatService.chatUserId = str2;
}
@JavascriptInterface
public void storeCallBackOpenChatScreen(String str) {
storeCallBackOpenChatScreen = str;
}
@JavascriptInterface
public void switchYoutubeVideo(String str) {
Hb.f fVar = youtubePlayer;
if (fVar != null) {
fVar.e(str, 0.0f);
}
}
@JavascriptInterface
public void updateSliderValue(final String str) {
ExecutorManager.runOnMainThread(new Runnable() {
@Override
public final void run() {
MobilityAppBridge.this.lambda$updateSliderValue$17(str);
}
});
}
}