正在查看: pg 娱乐 v1.0.7.202506242308 应用的 MTCommonActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: pg 娱乐 v1.0.7.202506242308 应用的 MTCommonActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.engagelab.privates.common.component;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import com.engagelab.privates.common.api.MTCommonPrivatesApi;
import com.engagelab.privates.common.log.MTCommonLog;
import com.engagelab.privates.common.utils.SM4Util;
import com.engagelab.privates.push.api.MTPushPrivatesApi;
import com.engagelab.privates.push.api.NotificationMessage;
import com.engagelab.privates.push.constants.MTPushConstants;
import com.engagelab.privates.push.utils.NotificationUtil;
import org.json.JSONObject;
public class MTCommonActivity extends Activity {
private static final String TAG = "MTCommonActivity";
private void processIntent(Intent intent) {
try {
if (intent == null) {
MTCommonLog.e(TAG, "processIntent intent is null ");
return;
}
Bundle extras = intent.getExtras();
String uri = intent.getData() != null ? intent.getData().toString() : "";
if (TextUtils.isEmpty(uri) && intent.getExtras() != null) {
uri = extras.containsKey("JMessageExtra") ? extras.getString("JMessageExtra") : extras.getString("MTMessageExtra");
}
if (TextUtils.isEmpty(uri)) {
int parseInt = Integer.parseInt(intent.getAction());
if (3003 == parseInt && ((NotificationMessage) extras.getParcelable(MTPushConstants.Message.KEY_MESSAGE)) == null) {
return;
}
MTPushPrivatesApi.init(getApplicationContext());
MTCommonPrivatesApi.sendMessageToMainProcess(getApplicationContext(), parseInt, extras);
} else {
processPlatformMessage(uri);
}
} catch (Throwable th) {
try {
MTCommonLog.w(TAG, "processIntent failed " + th.getMessage());
} finally {
finish();
}
}
}
private void processPlatformMessage(String str) {
String optString;
String optString2;
String optString3;
String str2;
Bundle bundle;
try {
String decodeMessage = SM4Util.decodeMessage(str);
if (TextUtils.isEmpty(decodeMessage)) {
return;
}
JSONObject jSONObject = new JSONObject(decodeMessage);
MTCommonLog.d(TAG, "platformMessageJson:" + MTCommonLog.toLogString(jSONObject));
String messageId = NotificationUtil.getMessageId(jSONObject);
byte optInt = (byte) jSONObject.optInt("rom_type");
if (jSONObject.has("m_content")) {
JSONObject optJSONObject = jSONObject.optJSONObject("m_content");
str2 = optJSONObject.optString("n_title");
optString = optJSONObject.optString("n_content");
optString2 = optJSONObject.optString("n_intent_uri");
optString3 = optJSONObject.optString("n_intent_ssl");
bundle = NotificationUtil.convertJsonToBundle(optJSONObject.optJSONObject("n_extras"));
} else {
String optString4 = jSONObject.optString("n_title");
optString = jSONObject.optString("n_content");
optString2 = jSONObject.optString("n_intent_uri");
optString3 = jSONObject.optString("n_intent_ssl");
Bundle convertJsonToBundle = NotificationUtil.convertJsonToBundle(jSONObject.optJSONObject("n_extras"));
str2 = optString4;
bundle = convertJsonToBundle;
}
NotificationMessage intentSsl = new NotificationMessage().setMessageId(messageId).setPlatform(optInt).setTitle(str2).setContent(optString).setExtras(bundle).setIntentUri(optString2).setIntentSsl(optString3);
Bundle bundle2 = new Bundle();
bundle2.putParcelable(MTPushConstants.Message.KEY_MESSAGE, intentSsl);
MTPushPrivatesApi.init(getApplicationContext());
MTCommonPrivatesApi.sendMessageToMainProcess(getApplicationContext(), 3003, bundle2);
} catch (Throwable th) {
MTCommonLog.w(TAG, "processPlatformMessage failed " + th.getMessage());
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
processIntent(getIntent());
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
processIntent(intent);
}
}