Initial commit
This commit is contained in:
198
sources/com/ubt/jimu/push/JimuNotification.java
Normal file
198
sources/com/ubt/jimu/push/JimuNotification.java
Normal file
@@ -0,0 +1,198 @@
|
||||
package com.ubt.jimu.push;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import com.ubt.jimu.R;
|
||||
import com.ubt.jimu.SplashActivity;
|
||||
import com.ubt.jimu.base.cache.SharePreferenceHelper;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubt.jimu.user.model.RefHolder;
|
||||
import com.ubt.jimu.user.view.RegisterActivity;
|
||||
import com.ubt.jimu.utils.DeviceUtils;
|
||||
import com.ubt.jimu.utils.JsonHelper;
|
||||
import com.ubtech.utils.XLog;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class JimuNotification {
|
||||
private String TAG = "JimuNotification";
|
||||
private Context context;
|
||||
private JimuPushMessage jimuMessage;
|
||||
private String message;
|
||||
private String title;
|
||||
|
||||
public JimuNotification(Context context, JimuPushMessage jimuPushMessage, String str) {
|
||||
this.jimuMessage = jimuPushMessage;
|
||||
this.message = str;
|
||||
this.title = context.getString(R.string.permission_app_name);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
private void openEmailRegister(JimuPushMessage jimuPushMessage) {
|
||||
if (!RefHolder.d() || jimuPushMessage == null || !RefHolder.c().equals(jimuPushMessage.getEmail())) {
|
||||
XLog.c(this.TAG, "hasn't request");
|
||||
turn2Foreground();
|
||||
return;
|
||||
}
|
||||
XLog.c(this.TAG, "start register activity & show dialog");
|
||||
Intent intent = new Intent(this.context, (Class<?>) RegisterActivity.class);
|
||||
SharePreferenceHelper sharePreferenceHelper = new SharePreferenceHelper();
|
||||
int i = sharePreferenceHelper.getInt(SharePreferenceHelper.SP_KEY_FLIPPER_PAGE_INDEX, 0);
|
||||
String string = sharePreferenceHelper.getString(SharePreferenceHelper.SP_KEY_REGISTER_BIRTHDAY, "");
|
||||
sharePreferenceHelper.getString(SharePreferenceHelper.SP_KEY_REGISTER_ACCOUNT, "");
|
||||
intent.putExtra(SharePreferenceHelper.SP_KEY_FLIPPER_PAGE_INDEX, i);
|
||||
intent.putExtra(SharePreferenceHelper.SP_KEY_REGISTER_BIRTHDAY, string);
|
||||
intent.putExtra(SharePreferenceHelper.SP_KEY_REGISTER_ACCOUNT, jimuPushMessage.getEmail());
|
||||
if (jimuPushMessage.checkThirdLogin()) {
|
||||
if (RefHolder.b() == null) {
|
||||
turn2Foreground();
|
||||
return;
|
||||
}
|
||||
String str = RefHolder.b().get("ubtsocial_user_id");
|
||||
if (TextUtils.isEmpty(str) || !str.equals(jimuPushMessage.getOpenId())) {
|
||||
turn2Foreground();
|
||||
return;
|
||||
}
|
||||
intent.putExtra("loginType", 2);
|
||||
}
|
||||
intent.setFlags(335544320);
|
||||
this.context.startActivity(intent);
|
||||
}
|
||||
|
||||
private void openJimu(JimuPushMessage jimuPushMessage, Class<? extends Activity> cls) {
|
||||
if (!DeviceUtils.d(this.context)) {
|
||||
this.context.startActivity(new Intent(this.context, cls));
|
||||
} else {
|
||||
Intent intent = new Intent(this.context, (Class<?>) SplashActivity.class);
|
||||
intent.setFlags(335544320);
|
||||
this.context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private void turn2Foreground() {
|
||||
if (DeviceUtils.d(this.context)) {
|
||||
XLog.c(this.TAG, "is background, turn foreground, start splashactivity");
|
||||
Intent intent = new Intent(this.context, (Class<?>) SplashActivity.class);
|
||||
intent.setFlags(335544320);
|
||||
intent.putExtra(Constant.Base.ACTIVITY_START_ACTION, 10001);
|
||||
this.context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:12:0x0058, code lost:
|
||||
|
||||
if (r1 == 1) goto L21;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x005a, code lost:
|
||||
|
||||
openJimu(r5.jimuMessage, com.ubt.jimu.main.activity.MainActivity.class);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:14:?, code lost:
|
||||
|
||||
return;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:16:0x0062, code lost:
|
||||
|
||||
openJimu(r5.jimuMessage, com.ubt.jimu.message.view.MessageCenterActivity.class);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:?, code lost:
|
||||
|
||||
return;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public void openNotification() {
|
||||
/*
|
||||
r5 = this;
|
||||
com.ubt.jimu.push.JimuPushMessage r0 = r5.jimuMessage
|
||||
if (r0 == 0) goto L9d
|
||||
java.lang.String r0 = r0.getNotificationType()
|
||||
boolean r0 = android.text.TextUtils.isEmpty(r0)
|
||||
if (r0 == 0) goto L10
|
||||
goto L9d
|
||||
L10:
|
||||
java.lang.String r0 = r5.TAG // Catch: java.lang.Exception -> L70
|
||||
java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L70
|
||||
r1.<init>() // Catch: java.lang.Exception -> L70
|
||||
java.lang.String r2 = "消息类型:"
|
||||
r1.append(r2) // Catch: java.lang.Exception -> L70
|
||||
com.ubt.jimu.push.JimuPushMessage r2 = r5.jimuMessage // Catch: java.lang.Exception -> L70
|
||||
java.lang.String r2 = r2.getNotificationType() // Catch: java.lang.Exception -> L70
|
||||
r1.append(r2) // Catch: java.lang.Exception -> L70
|
||||
java.lang.String r1 = r1.toString() // Catch: java.lang.Exception -> L70
|
||||
android.util.Log.i(r0, r1) // Catch: java.lang.Exception -> L70
|
||||
com.ubt.jimu.push.JimuPushMessage r0 = r5.jimuMessage // Catch: java.lang.Exception -> L70
|
||||
java.lang.String r0 = r0.getNotificationType() // Catch: java.lang.Exception -> L70
|
||||
r1 = -1
|
||||
int r2 = r0.hashCode() // Catch: java.lang.Exception -> L70
|
||||
r3 = -2029103300(0xffffffff870e573c, float:-1.0708529E-34)
|
||||
r4 = 1
|
||||
if (r2 == r3) goto L4d
|
||||
r3 = 1689354847(0x64b1825f, float:2.6195743E22)
|
||||
if (r2 == r3) goto L43
|
||||
goto L56
|
||||
L43:
|
||||
java.lang.String r2 = "emailRegister"
|
||||
boolean r0 = r0.equals(r2) // Catch: java.lang.Exception -> L70
|
||||
if (r0 == 0) goto L56
|
||||
r1 = 0
|
||||
goto L56
|
||||
L4d:
|
||||
java.lang.String r2 = "messageCenter"
|
||||
boolean r0 = r0.equals(r2) // Catch: java.lang.Exception -> L70
|
||||
if (r0 == 0) goto L56
|
||||
r1 = 1
|
||||
L56:
|
||||
if (r1 == 0) goto L6a
|
||||
if (r1 == r4) goto L62
|
||||
com.ubt.jimu.push.JimuPushMessage r0 = r5.jimuMessage // Catch: java.lang.Exception -> L70
|
||||
java.lang.Class<com.ubt.jimu.main.activity.MainActivity> r1 = com.ubt.jimu.main.activity.MainActivity.class
|
||||
r5.openJimu(r0, r1) // Catch: java.lang.Exception -> L70
|
||||
goto L9c
|
||||
L62:
|
||||
com.ubt.jimu.push.JimuPushMessage r0 = r5.jimuMessage // Catch: java.lang.Exception -> L70
|
||||
java.lang.Class<com.ubt.jimu.message.view.MessageCenterActivity> r1 = com.ubt.jimu.message.view.MessageCenterActivity.class
|
||||
r5.openJimu(r0, r1) // Catch: java.lang.Exception -> L70
|
||||
goto L9c
|
||||
L6a:
|
||||
com.ubt.jimu.push.JimuPushMessage r0 = r5.jimuMessage // Catch: java.lang.Exception -> L70
|
||||
r5.openEmailRegister(r0) // Catch: java.lang.Exception -> L70
|
||||
goto L9c
|
||||
L70:
|
||||
r0 = move-exception
|
||||
r0.printStackTrace()
|
||||
java.lang.String r1 = r5.TAG
|
||||
java.lang.StringBuilder r2 = new java.lang.StringBuilder
|
||||
r2.<init>()
|
||||
java.lang.String r3 = "点击通知栏exception:"
|
||||
r2.append(r3)
|
||||
com.ubt.jimu.push.JimuPushMessage r3 = r5.jimuMessage
|
||||
java.lang.String r3 = r3.getNotificationType()
|
||||
r2.append(r3)
|
||||
java.lang.String r3 = " error:"
|
||||
r2.append(r3)
|
||||
java.lang.String r0 = r0.getMessage()
|
||||
r2.append(r0)
|
||||
java.lang.String r0 = r2.toString()
|
||||
android.util.Log.i(r1, r0)
|
||||
L9c:
|
||||
return
|
||||
L9d:
|
||||
java.lang.String r0 = "JimuNotification"
|
||||
java.lang.String r1 = "jimuMessage null or notification type null"
|
||||
android.util.Log.e(r0, r1)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.ubt.jimu.push.JimuNotification.openNotification():void");
|
||||
}
|
||||
|
||||
public JimuNotification(Context context, String str, String str2) {
|
||||
this.jimuMessage = (JimuPushMessage) JsonHelper.a(str, (Class<?>) JimuPushMessage.class);
|
||||
this.message = str2;
|
||||
this.title = context.getString(R.string.permission_app_name);
|
||||
this.context = context;
|
||||
}
|
||||
}
|
104
sources/com/ubt/jimu/push/JimuPushMessage.java
Normal file
104
sources/com/ubt/jimu/push/JimuPushMessage.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package com.ubt.jimu.push;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class JimuPushMessage {
|
||||
public static final String KEY_USER_BIRTHDAY = "userBirthday";
|
||||
public static final String TYPE_CASE = "case";
|
||||
public static final String TYPE_COMMENT = "comment";
|
||||
public static final String TYPE_COMMUNITY_ACTIVITY = "communityActivities";
|
||||
public static final String TYPE_EMAIL_REGISTER = "emailRegister";
|
||||
public static final String TYPE_MESSAGE_CENTER = "messageCenter";
|
||||
public static final String TYPE_MODEL_RECOMMEMD = "recommend";
|
||||
public static final String TYPE_NEW_MODEL = "modelRecommend";
|
||||
public static final String TYPE_NEW_PACKAGE = "packageRecommend";
|
||||
public static final String TYPE_OFFLINE_ACtivity = "offlineActivities";
|
||||
public static final String TYPE_ONLINE_ACTIVITY = "onlineActivities";
|
||||
public static final String TYPE_SKILL = "skill";
|
||||
private String activityID;
|
||||
private AlertMessage aps;
|
||||
private String commentID;
|
||||
private String email;
|
||||
private String isCheckEmail = "1";
|
||||
private String modelID;
|
||||
private int notificationId;
|
||||
private String notificationType;
|
||||
private String openId;
|
||||
private String urlStr;
|
||||
private String userBirthday;
|
||||
|
||||
public class AlertMessage {
|
||||
private String alert;
|
||||
private String badge;
|
||||
|
||||
public AlertMessage() {
|
||||
}
|
||||
|
||||
public String getAlert() {
|
||||
return this.alert;
|
||||
}
|
||||
|
||||
public String getBadge() {
|
||||
return this.badge;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkThirdLogin() {
|
||||
return "0".equals(this.isCheckEmail);
|
||||
}
|
||||
|
||||
public String getActivityID() {
|
||||
return this.activityID;
|
||||
}
|
||||
|
||||
public AlertMessage getAps() {
|
||||
return this.aps;
|
||||
}
|
||||
|
||||
public String getCommentID() {
|
||||
return this.commentID;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return this.email;
|
||||
}
|
||||
|
||||
public String getIsCheckEmail() {
|
||||
return this.isCheckEmail;
|
||||
}
|
||||
|
||||
public String getModelID() {
|
||||
return this.modelID;
|
||||
}
|
||||
|
||||
public int getNotificationId() {
|
||||
return this.notificationId;
|
||||
}
|
||||
|
||||
public String getNotificationType() {
|
||||
return this.notificationType;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return this.openId;
|
||||
}
|
||||
|
||||
public String getUrlStr() {
|
||||
return this.urlStr;
|
||||
}
|
||||
|
||||
public String getUserBirthday() {
|
||||
return this.userBirthday;
|
||||
}
|
||||
|
||||
public void setIsCheckEmail(String str) {
|
||||
this.isCheckEmail = str;
|
||||
}
|
||||
|
||||
public void setNotificationId(int i) {
|
||||
this.notificationId = i;
|
||||
}
|
||||
|
||||
public void setOpenId(String str) {
|
||||
this.openId = str;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user