正在查看: CallApp v2.226 应用的 CallAppFirebaseMessagingService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: CallApp v2.226 应用的 CallAppFirebaseMessagingService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.callapp.contacts.manager.messaging;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Parcelable;
import android.util.Pair;
import com.appsflyer.AppsFlyerLib;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.callapp.contacts.CallAppApplication;
import com.callapp.contacts.Init;
import com.callapp.contacts.R;
import com.callapp.contacts.activity.whoViewedMyProfile.WhoViewedMyProfileDataManager;
import com.callapp.contacts.loader.PreferredSimManager;
import com.callapp.contacts.manager.BlockManager;
import com.callapp.contacts.manager.CallAppRemoteConfigManager;
import com.callapp.contacts.manager.ContactLoaderManager;
import com.callapp.contacts.manager.FeedbackManager;
import com.callapp.contacts.manager.NotificationManager;
import com.callapp.contacts.manager.VirtualNumberBalanceDataManager;
import com.callapp.contacts.manager.VirtualNumberDataManager;
import com.callapp.contacts.manager.analytics.AnalyticsManager;
import com.callapp.contacts.manager.phone.PhoneManager;
import com.callapp.contacts.manager.popup.DialogPopup;
import com.callapp.contacts.manager.popup.PopupManager;
import com.callapp.contacts.manager.preferences.Prefs;
import com.callapp.contacts.manager.sim.MultiSimManager;
import com.callapp.contacts.manager.sim.SimManager;
import com.callapp.contacts.manager.sms.SmsReceivedTask;
import com.callapp.contacts.manager.task.Task;
import com.callapp.contacts.manager.virtualNumber.VirtualNumberCancellationHandler;
import com.callapp.contacts.manager.virtualNumber.VirtualNumberInfoRepositoryImpl;
import com.callapp.contacts.manager.virtualNumber.VirtualNumberPurchaseDataManager;
import com.callapp.contacts.manager.virtualNumber.VirtualNumberRenewalHandler;
import com.callapp.contacts.manager.virtualNumber.dataSource.BaseApiResponseKt;
import com.callapp.contacts.manager.virtualNumber.dataSource.VirtualNumberBalanceRemoteDataSource;
import com.callapp.contacts.manager.virtualNumber.dataSource.VirtualNumberExpiredHandler;
import com.callapp.contacts.model.Constants;
import com.callapp.contacts.model.contact.ContactData;
import com.callapp.contacts.model.contact.ContactDataChangeListener;
import com.callapp.contacts.model.contact.ContactField;
import com.callapp.contacts.model.contact.social.ContactFieldEnumSets;
import com.callapp.contacts.model.invites.ReferAndEarnDataManager;
import com.callapp.contacts.model.objectbox.ENTRYPOINT;
import com.callapp.contacts.model.objectbox.ProfileViewedData;
import com.callapp.contacts.model.objectbox.ProfileViewedData_;
import com.callapp.contacts.model.objectbox.TYPE;
import com.callapp.contacts.model.objectbox.VirtualNumberBalanceData;
import com.callapp.contacts.model.objectbox.VirtualNumberData;
import com.callapp.contacts.popup.contact.DialogMessageWithTopImage;
import com.callapp.contacts.util.Activities;
import com.callapp.contacts.util.AppRater;
import com.callapp.contacts.util.CLog;
import com.callapp.contacts.util.HtmlUtils;
import com.callapp.contacts.util.ThemeUtils;
import com.callapp.contacts.util.date.DateUtils;
import com.callapp.framework.phone.Phone;
import com.callapp.framework.util.CollectionUtils;
import com.callapp.framework.util.StringUtils;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.twilio.voice.CallException;
import com.twilio.voice.CallInvite;
import com.twilio.voice.CancelledCallInvite;
import com.twilio.voice.MessageListener;
import com.twilio.voice.Voice;
import h4.u;
import io.objectbox.a;
import io.objectbox.g;
import io.objectbox.query.QueryBuilder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
import kotlin.jvm.internal.Intrinsics;
public class CallAppFirebaseMessagingService extends FirebaseMessagingService {
public static final int b = 0;
public static class WhoViewedMyProfileContactDataChangerListener implements ContactDataChangeListener {
final ENTRYPOINT entrypoint;
final String fullName;
final String globalNumber;
final AtomicBoolean viewMeAdded = new AtomicBoolean(false);
public WhoViewedMyProfileContactDataChangerListener(String str, String str2, ENTRYPOINT entrypoint) {
this.globalNumber = str;
this.fullName = str2;
this.entrypoint = entrypoint;
}
@Override
public void onContactChanged(ContactData contactData, Set<ContactField> set) {
if (CollectionUtils.b(set, ContactField.genomeData, ContactField.fullName, ContactField.names)) {
ContactLoaderManager.get().unRegisterForContactDetailsStack(contactData, this);
if (this.viewMeAdded.getAndSet(true) || contactData.isIncognito() || contactData.isSpammer()) {
return;
}
String str = this.globalNumber;
String nameOrNumber = contactData.getNameOrNumber();
ENTRYPOINT entrypoint = this.entrypoint;
ReentrantLock reentrantLock = WhoViewedMyProfileDataManager.c;
WhoViewedMyProfileDataManager.a.getClass();
Intrinsics.checkNotNullParameter(str, "viewerPhone");
Intrinsics.checkNotNullParameter(nameOrNumber, "viewerName");
Intrinsics.checkNotNullParameter(entrypoint, Constants.EXTRA_ENTRY_POINT);
try {
reentrantLock.lock();
a aVar = WhoViewedMyProfileDataManager.d;
QueryBuilder i = aVar.i();
i.k(ProfileViewedData_.phoneNumber, str, QueryBuilder.b.CASE_INSENSITIVE);
i.e(QueryBuilder.a.AND);
g gVar = ProfileViewedData_.type;
TYPE type = TYPE.VIEWME;
i.j(gVar, type.getValue());
i.B(ProfileViewedData_.lastViewed, 1);
ProfileViewedData profileViewedData = (ProfileViewedData) i.b().j0();
if (profileViewedData != null && DateUtils.h(new Date(profileViewedData.getLastViewed()), new Date()) < 7) {
profileViewedData.setCounter(profileViewedData.getCounter() + 1);
profileViewedData.setLastViewed(System.currentTimeMillis());
profileViewedData.setName(nameOrNumber);
aVar.g(profileViewedData);
AnalyticsManager.get().o(Constants.WHO_VIEWED_MY_PROFILE_CATEGORY, "ViewProfileCount");
if (Prefs.M6.get() == WhoViewedMyProfileDataManager.NotificationWhoViewedMyProfile.INSTANT && !Prefs.O6.get().booleanValue() && Prefs.N6.get().booleanValue()) {
NotificationManager.get().Q(str, nameOrNumber);
}
reentrantLock.unlock();
new Task() {
@Override
public final void doTask() {
WhoViewedMyProfileDataManager.Companion.a(WhoViewedMyProfileDataManager.a);
}
}.execute();
}
aVar.g(new ProfileViewedData(0L, str, entrypoint, System.currentTimeMillis(), nameOrNumber, 0, type, 33, null));
Prefs.P6.a(1);
AnalyticsManager.get().o(Constants.WHO_VIEWED_MY_PROFILE_CATEGORY, "ViewProfileCount");
if (Prefs.M6.get() == WhoViewedMyProfileDataManager.NotificationWhoViewedMyProfile.INSTANT) {
NotificationManager.get().Q(str, nameOrNumber);
}
reentrantLock.unlock();
new Task() {
@Override
public final void doTask() {
WhoViewedMyProfileDataManager.Companion.a(WhoViewedMyProfileDataManager.a);
}
}.execute();
} catch (Throwable th) {
reentrantLock.unlock();
throw th;
}
}
}
}
public static void c(Map map) {
String str = (String) map.get("callapp_fcm_dialog_applink");
if (StringUtils.x(str)) {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
intent.setPackage(CallAppApplication.get().getPackageName());
if (Activities.l(intent)) {
Activities.E(CallAppApplication.get(), intent);
return;
}
Intent intent2 = new Intent("android.intent.action.VIEW");
intent2.setData(Uri.parse(str));
if (Activities.l(intent2)) {
Activities.E(CallAppApplication.get(), intent2);
}
}
}
public static void d(String str, final Map map) {
if (!StringUtils.k(str, "448940416822")) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
}
String str2 = (String) map.get("callapp_message_id");
String str3 = (String) map.get("audience_country_equals");
String str4 = (String) map.get("audience_version_equals");
String str5 = (String) map.get("audience_version_equals_or_lower");
String str6 = (String) map.get("audience_version_equals_or_higher");
String str7 = (String) map.get("audience_only_premium");
String str8 = (String) map.get("audience_only_not_premium");
String str9 = (String) map.get("audience_more_than_days_since_install");
String str10 = (String) map.get("audience_less_or_equal_days_since_install");
if (StringUtils.x(str3) && !StringUtils.m(str3, PhoneManager.get().getCountryIso())) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
if (StringUtils.x(str4)) {
try {
if (Integer.valueOf(str4).intValue() != CallAppApplication.get().getVersionCode()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
} catch (NumberFormatException unused) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
}
if (StringUtils.x(str5)) {
try {
if (CallAppApplication.get().getVersionCode() > Integer.valueOf(str5).intValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
} catch (NumberFormatException unused2) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
}
if (StringUtils.x(str6)) {
try {
if (CallAppApplication.get().getVersionCode() < Integer.valueOf(str6).intValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
} catch (NumberFormatException unused3) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
}
if (StringUtils.x(str7) && !Prefs.S2.get().booleanValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
if (StringUtils.x(str8) && Prefs.S2.get().booleanValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
if (StringUtils.x(str9)) {
try {
if (CallAppApplication.get().getDaysSinceInstall() <= Long.valueOf(str9).longValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
} catch (NumberFormatException unused4) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
}
if (StringUtils.x(str10)) {
try {
if (CallAppApplication.get().getDaysSinceInstall() > Long.valueOf(str10).longValue()) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
} catch (NumberFormatException unused5) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
}
if (!StringUtils.x(str2)) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
return;
}
str2.getClass();
switch (str2) {
case "callapp_rate_us":
if (!AppRater.isRatedYet()) {
AppRater.b(CallAppApplication.get(), null, true, true);
break;
} else {
"Discarding message due to user already rated: ".concat(str2);
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
break;
}
case "callapp_deeplink":
if (!StringUtils.m((String) map.get("callapp_fcm_dialog_force_remote_config"), "true")) {
c(map);
break;
} else {
CallAppRemoteConfigManager.get().a(true, new CallAppRemoteConfigManager.FetchDoneListener() {
@Override
public final void d(Exception exc, boolean z) {
CallAppFirebaseMessagingService.c(map);
}
});
break;
}
case "callapp_fcm_dialog":
final String str11 = (String) map.get("callapp_fcm_dialog_image");
final String str12 = (String) map.get("callapp_fcm_dialog_title");
final String str13 = (String) map.get("callapp_fcm_dialog_message");
final String string = StringUtils.x((CharSequence) map.get("callapp_fcm_dialog_ok_button_text")) ? (String) map.get("callapp_fcm_dialog_ok_button_text") : Activities.getString(R.string.ok);
final String string2 = StringUtils.x((CharSequence) map.get("callapp_fcm_dialog_cancel_button_text")) ? (String) map.get("callapp_fcm_dialog_cancel_button_text") : Activities.getString(R.string.cancel);
final String str14 = (String) map.get("callapp_fcm_dialog_applink");
final String str15 = (String) map.get("callapp_fcm_dialog_applink_negative");
if (!StringUtils.x(str12) || !StringUtils.x(str13)) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
break;
} else if (!StringUtils.x(str11)) {
e(null, str12, str13, string, string2, str14, str15);
break;
} else {
new Task() {
@Override
public final void doTask() {
CallAppFirebaseMessagingService.e(str11, str12, str13, string, string2, str14, str15);
}
}.execute();
break;
}
default:
"Discarding message due to invalid message id: ".concat(str2);
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
break;
}
}
public static void e(String str, String str2, String str3, String str4, String str5, final String str6, final String str7) {
PopupManager.get().c(CallAppApplication.get(), new DialogMessageWithTopImage(str, R.drawable.whats_new_header_general, str2, HtmlUtils.a(str3), str4, new DialogPopup.IDialogOnClickListener() {
@Override
public final void onClickListener(Activity activity) {
String str8 = str6;
if (StringUtils.x(str8)) {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str8));
intent.setPackage("com.callapp.contacts");
if (Activities.l(intent)) {
Activities.E(CallAppApplication.get(), intent);
} else {
Activities.E(CallAppApplication.get(), new Intent("android.intent.action.VIEW", Uri.parse(str8)));
}
}
}
}, str5, ThemeUtils.getColor(R.color.disabled), new DialogPopup.IDialogOnClickListener() {
@Override
public final void onClickListener(Activity activity) {
String str8 = str7;
if (StringUtils.x(str8)) {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str8));
intent.setPackage("com.callapp.contacts");
if (Activities.l(intent)) {
Activities.E(CallAppApplication.get(), intent);
} else {
Activities.E(CallAppApplication.get(), new Intent("android.intent.action.VIEW", Uri.parse(str8)));
}
}
}
}) {
}, true);
}
public final void onCreate() {
Init.e(null);
super/*android.app.Service*/.onCreate();
}
public final void onMessageReceived(RemoteMessage remoteMessage) {
remoteMessage.getFrom();
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
Objects.toString(remoteMessage.getData());
CLog.a();
Map data = remoteMessage.getData();
if (data.containsKey("vnbody") && data.containsKey("vnfrom")) {
if (!Activities.isDefaultSMSApp()) {
NotificationManager.get().Z();
return;
}
Intent intent = new Intent("VIRTUAL_NUMBER_INCOMING_SMS_DEFAULT");
intent.putExtra("EXTRA_MESSAGE_BODY", (String) remoteMessage.getData().get("vnbody"));
intent.putExtra("EXTRA_ORIGINATING_ADDRESS", (String) remoteMessage.getData().get("vnfrom"));
intent.putExtra("EXTRA_SUB_ID", -1);
intent.putExtra("EXTRA_TIMESTAMP_MILLIS", System.currentTimeMillis());
intent.putExtra("EXTRA_MESSAGE_TO", (String) remoteMessage.getData().get("vnto"));
new SmsReceivedTask(null, intent).execute();
}
if (data.containsKey("twi_call_sid")) {
Objects.toString(remoteMessage.getData());
CLog.a();
if (Voice.handleMessage(this, remoteMessage.getData(), new MessageListener() {
public final void onCallInvite(CallInvite callInvite) {
CLog.a();
int i = CallAppFirebaseMessagingService.b;
FirebaseMessagingService firebaseMessagingService = CallAppFirebaseMessagingService.this;
firebaseMessagingService.getClass();
Intent intent2 = new Intent();
intent2.setAction("ACTION_INCOMING_CALL");
intent2.putExtra("INCOMING_CALL_INVITE", (Parcelable) callInvite);
v1.a.a(firebaseMessagingService).c(intent2);
}
public final void onCancelledCallInvite(CancelledCallInvite cancelledCallInvite, CallException callException) {
CLog.a();
int i = CallAppFirebaseMessagingService.b;
FirebaseMessagingService firebaseMessagingService = CallAppFirebaseMessagingService.this;
firebaseMessagingService.getClass();
Intent intent2 = new Intent();
intent2.setAction("ACTION_CANCEL_CALL");
intent2.putExtra("CANCELLED_CALL_INVITE", (Parcelable) cancelledCallInvite);
v1.a.a(firebaseMessagingService).c(intent2);
}
})) {
return;
}
}
if (data.containsKey("vnsubcancelled")) {
new VirtualNumberCancellationHandler().a((String) data.getOrDefault("vnto", null), (String) data.getOrDefault("vnbody", null));
}
if (data.containsKey("vnsubrenewed")) {
String str = (String) data.getOrDefault("vnto", null);
String str2 = (String) data.getOrDefault("vnsubexpiry", null);
new VirtualNumberRenewalHandler();
if (!StringUtils.t(str) && str != null) {
if ((StringUtils.x(str) ? str : null) != null) {
BaseApiResponseKt.a(new VirtualNumberInfoRepositoryImpl(new VirtualNumberBalanceRemoteDataSource()).a(str), new u(25));
VirtualNumberBalanceData b2 = VirtualNumberBalanceDataManager.b(str);
if (b2 != null) {
long j = 0;
if (str2 != null) {
try {
j = Long.parseLong(str2);
} catch (NumberFormatException unused) {
}
}
VirtualNumberBalanceDataManager.d(VirtualNumberBalanceDataManager.a, str, null, null, b2.getSkuMinArgOrg(), b2.getSkuSmsArgOrg(), null, null, Long.valueOf(j), null, null, null, null, null, Boolean.TRUE, 8038);
}
}
}
CLog.a();
}
if (data.containsKey("vnsubexpired")) {
String str3 = (String) data.getOrDefault("vnto", null);
new VirtualNumberExpiredHandler();
if (str3 != null && str3.length() != 0) {
List<MultiSimManager.SimDetails> virtualNumbers = MultiSimManager.a.getVirtualNumbers();
ArrayList arrayList = new ArrayList();
for (Object obj : virtualNumbers) {
if (!Intrinsics.a(((MultiSimManager.SimDetails) obj).getPhoneNumber(), str3)) {
arrayList.add(obj);
}
}
MultiSimManager.a.getClass();
Intrinsics.checkNotNullParameter(arrayList, "numberList");
int size = arrayList.size();
ArrayList arrayList2 = new ArrayList(size);
for (int i = 0; i < size; i++) {
arrayList2.add(new MultiSimManager.SimDetails(((MultiSimManager.SimDetails) arrayList.get(i)).getPhoneNumber(), null, Constants.SECOND_NUMBER, SimManager.SimId.VN_1.getSimId() + i));
}
int i2 = VirtualNumberDataManager.a;
CallAppApplication.get().getObjectBoxStore().u(VirtualNumberData.class).q();
VirtualNumberDataManager.a(arrayList);
PreferredSimManager.a.f(PreferredSimManager.UpdateType.SIM_REMOVED);
VirtualNumberPurchaseDataManager virtualNumberPurchaseDataManager = VirtualNumberPurchaseDataManager.a;
VirtualNumberPurchaseDataManager.b(virtualNumberPurchaseDataManager, null, null, null, null, str3, null, null, null, 495);
Objects.toString(VirtualNumberDataManager.getVirtualNumbers());
CLog.a();
if (VirtualNumberPurchaseDataManager.getVirtualNumberPurchaseData() != null) {
VirtualNumberPurchaseDataManager.b(virtualNumberPurchaseDataManager, null, null, "", "", null, "", "", null, TTAdConstant.DEEPLINK_UNAVAILABLE_CODE);
}
AnalyticsManager.get().o(Constants.SECOND_NUMBER, "RemoveSecondNumber");
NotificationManager.get().a0(str3, !NotificationManager.NotificationTimeUtils.isCurrentTimeDisturbing());
}
CLog.a();
}
if (remoteMessage.getNotification() != null) {
String str4 = remoteMessage.getNotification().a;
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
}
if (remoteMessage.toIntent().hasExtra("key")) {
ReferAndEarnDataManager.addThePoints(remoteMessage.toIntent().getExtras().getString("key"), remoteMessage.toIntent().getExtras().getString("pn"), Integer.parseInt(remoteMessage.toIntent().getExtras().getString("points")) * ((int) CallAppRemoteConfigManager.get().c("ReferAndEarnPointValue")));
return;
}
if (!remoteMessage.toIntent().hasExtra("myp")) {
d(remoteMessage.getFrom(), remoteMessage.getData());
return;
}
String string = remoteMessage.toIntent().getExtras().getString("myp");
String string2 = remoteMessage.toIntent().getExtras().getString("vs");
String string3 = remoteMessage.toIntent().getExtras().getString("nm");
ENTRYPOINT entrypoint = StringUtils.y(string2, true) ? ENTRYPOINT.values()[Integer.parseInt(string2)] : null;
FeedbackManager.get().a(string + " " + string3 + " " + entrypoint);
if (entrypoint == null || !StringUtils.x(string) || BlockManager.g(PhoneManager.get().e(string))) {
return;
}
WhoViewedMyProfileContactDataChangerListener whoViewedMyProfileContactDataChangerListener = new WhoViewedMyProfileContactDataChangerListener(string, string3, entrypoint);
Pair<ContactData, Set<ContactField>> registerForContactDetailsStack = ContactLoaderManager.get().registerForContactDetailsStack(new Phone(string), null, 0L, whoViewedMyProfileContactDataChangerListener, ContactFieldEnumSets.ALL);
if (((Set) registerForContactDetailsStack.second).size() > 0) {
whoViewedMyProfileContactDataChangerListener.onContactChanged((ContactData) registerForContactDetailsStack.first, (Set) registerForContactDetailsStack.second);
}
}
public final void onNewToken(String str) {
StringUtils.I(CallAppFirebaseMessagingService.class);
CLog.a();
FcmManager.get().a();
try {
AppsFlyerLib.getInstance().updateServerUninstallToken(CallAppApplication.get(), str);
} catch (Exception unused) {
}
}
}