正在查看: Hopscotch v9.7.2 应用的 CTNotificationIntentService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Hopscotch v9.7.2 应用的 CTNotificationIntentService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clevertap.android.sdk.pushnotification;
import android.annotation.SuppressLint;
import android.app.IntentService;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import com.clevertap.android.sdk.n1;
import com.clevertap.android.sdk.pushnotification.i;
import com.clevertap.android.sdk.u;
import com.clevertap.android.sdk.y0;
@Deprecated(since = "4.3.0")
public class CTNotificationIntentService extends IntentService {
public static final String MAIN_ACTION = "com.clevertap.PUSH_EVENT";
public static final String TYPE_BUTTON_CLICK = "com.clevertap.ACTION_BUTTON_CLICK";
private com.clevertap.android.sdk.interfaces.a mActionButtonClickHandler;
public CTNotificationIntentService() {
super("CTNotificationIntentService");
}
@SuppressLint({"MissingPermission"})
private void handleActionButtonClick(Bundle bundle) {
Intent launchIntentForPackage;
NotificationManager notificationManager;
try {
boolean z = bundle.getBoolean("autoCancel", false);
int i = bundle.getInt("notificationId", -1);
String string = bundle.getString("dl");
Context applicationContext = getApplicationContext();
if (!this.mActionButtonClickHandler.b(i, applicationContext, bundle) && Build.VERSION.SDK_INT < 31) {
if (string != null) {
launchIntentForPackage = new Intent("android.intent.action.VIEW", Uri.parse(string));
n1.i(applicationContext, launchIntentForPackage);
} else {
launchIntentForPackage = applicationContext.getPackageManager().getLaunchIntentForPackage(applicationContext.getPackageName());
}
if (launchIntentForPackage == null) {
y0.j("CTNotificationService: create launch intent.");
return;
}
launchIntentForPackage.setFlags(872415232);
launchIntentForPackage.putExtras(bundle);
launchIntentForPackage.removeExtra("dl");
String string2 = bundle.getString("pt_dismiss_on_click", "");
if (z && i > -1 && string2.isEmpty() && (notificationManager = (NotificationManager) getApplicationContext().getSystemService("notification")) != null) {
notificationManager.cancel(i);
}
sendBroadcast(new Intent("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
startActivity(launchIntentForPackage);
}
} catch (Throwable th) {
y0.j("CTNotificationService: unable to process action button click: " + th.getLocalizedMessage());
}
}
@Override
public void onHandleIntent(Intent intent) {
i iVar;
Bundle extras = intent.getExtras();
if (extras == null) {
return;
}
com.clevertap.android.sdk.interfaces.d z = u.z();
if (!i.c(extras) || z == null) {
iVar = i.b.INSTANCE;
this.mActionButtonClickHandler = iVar;
} else {
this.mActionButtonClickHandler = (com.clevertap.android.sdk.interfaces.a) z;
}
if (TYPE_BUTTON_CLICK.equals(extras.getString("ct_type"))) {
y0.j("CTNotificationIntentService handling com.clevertap.ACTION_BUTTON_CLICK");
handleActionButtonClick(extras);
} else {
y0.j("CTNotificationIntentService: unhandled intent " + intent.getAction());
}
}
}